Use __isArrayLike() and __isByteArrayLike()
authorStefan Vogel <sv@exept.de>
Mon, 01 Feb 2010 19:17:08 +0100
changeset 2818 37b97e4ebb01
parent 2817 f8b08ad94d28
child 2819 691218db6b3c
Use __isArrayLike() and __isByteArrayLike() Use __MKEXTERNALADDRESS() instead of __MKOBJ()
WinPrinterContext.st
--- a/WinPrinterContext.st	Wed Jan 20 14:25:14 2010 +0100
+++ b/WinPrinterContext.st	Mon Feb 01 19:17:08 2010 +0100
@@ -3094,23 +3094,23 @@
 
     /*console_printf("CreateBitmap Color\n");*/
     if (__bothSmallInteger(w, h) && __isSmallInteger(d) /*&& ISCONNECTED */) {
-	if (__intVal(d) == 1) {
-	    newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
-	} else {
+        if (__intVal(d) == 1) {
+            newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
+        } else {
 #if 0
-	    if (__intVal(d) != __depth) {
-		console_printf("invalid depth\n");
-		RETURN (nil);
-	    }
+            if (__intVal(d) != __depth) {
+                console_printf("invalid depth\n");
+                RETURN (nil);
+            }
 #endif
-	    newBitmapHandle = CreateCompatibleBitmap(rootDC, __intVal(w), __intVal(h) );
-	}
-
-	if (newBitmapHandle) {
-	    RETURN ( __MKOBJ(newBitmapHandle));
-	}
+            newBitmapHandle = CreateCompatibleBitmap(rootDC, __intVal(w), __intVal(h) );
+        }
+
+        if (newBitmapHandle) {
+            RETURN ( __MKEXTERNALADDRESS(newBitmapHandle));
+        }
 /*
-	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
+        DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
 */
     }
     RETURN (nil);
@@ -3275,71 +3275,71 @@
     unsigned char fastBits[10000];
 
     if (__bothSmallInteger(w, h)
-     && _isNonNilObject(anArray)) {
-	OBJ cls = __qClass(anArray);
-
-	b_width = __intVal(w);
-	b_height = __intVal(h);
-	bytesPerRowST = (b_width + 7) / 8;
-	bytesPerRowWN = ((b_width + 15) / 16) * 2;
-	padding = bytesPerRowWN - bytesPerRowST;
-
-	if ((padding == 0) && (cls == @global(ByteArray))) {
-	    b_bits = __ByteArrayInstPtr(anArray)->ba_element;
-	    cp = 0;
-	} else {
-	    int nBytes = b_height * bytesPerRowWN;
-
-	    if (nBytes < sizeof(fastBits)) {
-		cp = b_bits = fastBits;
-	    } else {
-		cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
-		if (! cp) goto fail;
-	    }
-	}
-	if (cp) {
-	    if (cls == @global(Array)) {
-		OBJ *op;
-
-		index = 1;
-		op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
-		for (row = b_height; row; row--) {
-		    for (col = bytesPerRowST; col; col--) {
-			num = *op++;
-			if (! __isSmallInteger(num))
-			    goto fail;
-			*cp++ = __intVal(num);
-		    }
-		    cp += padding;
-		}
-	    } else if (cls == @global(ByteArray)) {
-		unsigned char *pBits;
-
-		pBits = __ByteArrayInstPtr(anArray)->ba_element;
-		for (row = b_height; row; row--) {
-		    for (col = bytesPerRowST; col; col--) {
-			*cp++ = ( *pBits++ /*^ 0xFF*/ );
-		    }
-		    cp += padding;
-		}
-	    } else {
-		goto fail;
-	    }
-	}
+     && __isNonNilObject(anArray)) {
+        OBJ cls = __qClass(anArray);
+
+        b_width = __intVal(w);
+        b_height = __intVal(h);
+        bytesPerRowST = (b_width + 7) / 8;
+        bytesPerRowWN = ((b_width + 15) / 16) * 2;
+        padding = bytesPerRowWN - bytesPerRowST;
+
+        if ((padding == 0) && (cls == @global(ByteArray))) {
+            b_bits = __ByteArrayInstPtr(anArray)->ba_element;
+            cp = 0;
+        } else {
+            int nBytes = b_height * bytesPerRowWN;
+
+            if (nBytes < sizeof(fastBits)) {
+                cp = b_bits = fastBits;
+            } else {
+                cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
+                if (! cp) goto fail;
+            }
+        }
+        if (cp) {
+            if (__qIsArrayLike(anArray)) {
+                OBJ *op;
+
+                index = 1;
+                op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
+                for (row = b_height; row; row--) {
+                    for (col = bytesPerRowST; col; col--) {
+                        num = *op++;
+                        if (! __isSmallInteger(num))
+                            goto fail;
+                        *cp++ = __intVal(num);
+                    }
+                    cp += padding;
+                }
+            } else if (__qIsByteArrayLike(anArray)) {
+                unsigned char *pBits;
+
+                pBits = __ByteArrayInstPtr(anArray)->ba_element;
+                for (row = b_height; row; row--) {
+                    for (col = bytesPerRowST; col; col--) {
+                        *cp++ = ( *pBits++ /*^ 0xFF*/ );
+                    }
+                    cp += padding;
+                }
+            } else {
+                goto fail;
+            }
+        }
 /*
-	CPRINTF(("create bitmap ...\n"));
+        CPRINTF(("create bitmap ...\n"));
 */
-	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, b_bits );
-
-	if (newBitmapHandle ) {
+        newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, b_bits );
+
+        if (newBitmapHandle ) {
 /*
-	    DDPRINTF(("returning bitmap %x ...\n", newBitmapHandle));
+            DDPRINTF(("returning bitmap %x ...\n", newBitmapHandle));
 */
-	    if (allocatedBits) {
-		free(allocatedBits);
-	    }
-	    RETURN ( __MKOBJ(newBitmapHandle));
-	}
+            if (allocatedBits) {
+                free(allocatedBits);
+            }
+            RETURN ( __MKEXTERNALADDRESS(newBitmapHandle));
+        }
     }
 fail: ;
 /*
@@ -3347,9 +3347,9 @@
 */
     if (allocatedBits) {
 /*
-	CPRINTF(("freeing up bitmap bits ...\n"));
+        CPRINTF(("freeing up bitmap bits ...\n"));
 */
-	free(allocatedBits);
+        free(allocatedBits);
     }
 /*
     CPRINTF(("returning nil ...\n"));
@@ -4119,25 +4119,25 @@
     HGDIOBJ hFont;
     char *fn;
 
-    if (__isString(aFontName) || __isSymbol(aFontName)) {
-	fn = __stringVal(aFontName);
-	if ((strcmp(fn, "fixed") == 0) || (strcmp(fn, "ANSI_FIXED_FONT") == 0)) {
-	    hFont = GetStockObject(ANSI_FIXED_FONT);
-	} else if ((strcmp(fn, "variable") == 0) || (strcmp(fn, "ANSI_VAR_FONT") == 0)) {
-	    hFont = GetStockObject(ANSI_VAR_FONT);
-	} else if ((strcmp(fn, "system") == 0) || (strcmp(fn, "SYSTEM_FONT") == 0)) {
-	    hFont = GetStockObject(SYSTEM_FONT);
-	} else if ((strcmp(fn, "systemFixed") == 0) || (strcmp(fn, "SYSTEM_FIXED_FONT") == 0)) {
-	    hFont = GetStockObject(SYSTEM_FIXED_FONT);
-	} else if ((strcmp(fn, "deviceDefault") == 0) || (strcmp(fn, "DEVICE_DEFAULT_FONT") == 0)) {
-	    hFont = GetStockObject(DEVICE_DEFAULT_FONT);
-	} else {
-	    hFont = GetStockObject(ANSI_FIXED_FONT);
-	}
-	if (hFont) {
-	    DPRINTF(("createFontFor:%s -> %x\n", fn, hFont));
-	    RETURN ( __MKOBJ(hFont) );
-	}
+    if (__isStringLike(aFontName)) {
+        fn = __stringVal(aFontName);
+        if ((strcmp(fn, "fixed") == 0) || (strcmp(fn, "ANSI_FIXED_FONT") == 0)) {
+            hFont = GetStockObject(ANSI_FIXED_FONT);
+        } else if ((strcmp(fn, "variable") == 0) || (strcmp(fn, "ANSI_VAR_FONT") == 0)) {
+            hFont = GetStockObject(ANSI_VAR_FONT);
+        } else if ((strcmp(fn, "system") == 0) || (strcmp(fn, "SYSTEM_FONT") == 0)) {
+            hFont = GetStockObject(SYSTEM_FONT);
+        } else if ((strcmp(fn, "systemFixed") == 0) || (strcmp(fn, "SYSTEM_FIXED_FONT") == 0)) {
+            hFont = GetStockObject(SYSTEM_FIXED_FONT);
+        } else if ((strcmp(fn, "deviceDefault") == 0) || (strcmp(fn, "DEVICE_DEFAULT_FONT") == 0)) {
+            hFont = GetStockObject(DEVICE_DEFAULT_FONT);
+        } else {
+            hFont = GetStockObject(ANSI_FIXED_FONT);
+        }
+        if (hFont) {
+            DPRINTF(("createFontFor:%s -> %x\n", fn, hFont));
+            RETURN ( __MKEXTERNALADDRESS(hFont) );
+        }
     }
 %}.
     ^ nil
@@ -4305,8 +4305,8 @@
 !
 
 getFontWithFoundry:foundry family:family weight:weight
-	      slant:slant spacing:spc pixelSize:pixelSize size:pointSize
-	      registry:registry encoding:encoding
+              slant:slant spacing:spc pixelSize:pixelSize size:pointSize
+              registry:registry encoding:encoding
 
     "get the specified font, if not available, return nil.
      For now, this is a poor (incomplete) emulation of the X code ...
@@ -4326,43 +4326,43 @@
     "
      Windows-NT/95 allows the creation of a font with the following parameters
 
-	nHeight
-	nWidth
-	nEscapement
-	nOrientation
-	fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
-	fdwItalic       TRUE or FALSE
-	fdwUnderline    TRUE or FALSE
-	fdwStrikeOut    TRUE or FALSE
-	fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
-	fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
-	fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
-	fdwQuality      DEFAULT, DRAFT, or PROOF.
-	fdwPitchAndFamily
-		DEFAULT, FIXED or VARIABLE pitch
-		DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
-	lpszFace
-		Typeface Name
+        nHeight
+        nWidth
+        nEscapement
+        nOrientation
+        fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
+        fdwItalic       TRUE or FALSE
+        fdwUnderline    TRUE or FALSE
+        fdwStrikeOut    TRUE or FALSE
+        fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
+        fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
+        fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
+        fdwQuality      DEFAULT, DRAFT, or PROOF.
+        fdwPitchAndFamily
+                DEFAULT, FIXED or VARIABLE pitch
+                DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
+        lpszFace
+                Typeface Name
 
       These two above descriptions will be matched as follows:
 
-	foundry   - ignored
-	family    - mapped to type face name.
-	weight    - mapped to fnWeight
-	slant     - used for style
-	spacing   - NOT USED INITIALLY
-	pixelSize - NOT USED INITIALLY
-	size      - mapped to nHeight
-	registry  - NOT USED INITIALLY
-	encoding  - mapped to fdwCharSet
+        foundry   - ignored
+        family    - mapped to type face name.
+        weight    - mapped to fnWeight
+        slant     - used for style
+        spacing   - NOT USED INITIALLY
+        pixelSize - NOT USED INITIALLY
+        size      - mapped to nHeight
+        registry  - NOT USED INITIALLY
+        encoding  - mapped to fdwCharSet
      "
 
     |logSize|
 
     pixelSize notNil ifTrue:[
-	logSize := pixelSize
+        logSize := pixelSize
     ] ifFalse:[
-	logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
+        logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
     ].
 %{
     HGDIOBJ hFont;
@@ -4397,152 +4397,152 @@
 
     fdwCharSet   = ANSI_CHARSET;
     if ((encoding == @symbol('ms-ansi'))) {
-	fdwCharSet   = ANSI_CHARSET;
+        fdwCharSet   = ANSI_CHARSET;
     } else if (encoding == @symbol('ms-default')) {
-	fdwCharSet   = DEFAULT_CHARSET;
+        fdwCharSet   = DEFAULT_CHARSET;
     } else if ((encoding == @symbol('ms-symbol'))
-	    || (encoding == @symbol('misc-fontspecific'))) {
-	fdwCharSet   = SYMBOL_CHARSET;
+            || (encoding == @symbol('misc-fontspecific'))) {
+        fdwCharSet   = SYMBOL_CHARSET;
     } else if ((encoding == @symbol('ms-shiftjis'))
-	    || (encoding == @symbol('jisx0208.1983-0'))){
-	fdwCharSet   = SHIFTJIS_CHARSET;
+            || (encoding == @symbol('jisx0208.1983-0'))){
+        fdwCharSet   = SHIFTJIS_CHARSET;
     } else if ((encoding == @symbol('ms-gb2312'))
-	    || (encoding == @symbol('gb2312.1980-0'))) {
-	fdwCharSet   = GB2312_CHARSET;
+            || (encoding == @symbol('gb2312.1980-0'))) {
+        fdwCharSet   = GB2312_CHARSET;
     } else if ((encoding == @symbol('ms-hangeul'))
-	    || (encoding == @symbol('ksc5601.1987-0'))) {
-	fdwCharSet   = HANGEUL_CHARSET;
+            || (encoding == @symbol('ksc5601.1987-0'))) {
+        fdwCharSet   = HANGEUL_CHARSET;
     } else if ((encoding == @symbol('ms-chinesebig5'))
-	    || (encoding == @symbol('big5'))) {
-	fdwCharSet   = CHINESEBIG5_CHARSET;
+            || (encoding == @symbol('big5'))) {
+        fdwCharSet   = CHINESEBIG5_CHARSET;
     } else if (encoding == @symbol('ms-oem')) {
-	fdwCharSet   = OEM_CHARSET;
+        fdwCharSet   = OEM_CHARSET;
     } else if (encoding == @symbol('ms-johab')) {
-	fdwCharSet   = JOHAB_CHARSET;
+        fdwCharSet   = JOHAB_CHARSET;
     } else if ((encoding == @symbol('ms-hebrew'))
-	    || (encoding == @symbol('ms-cp1255'))) {
-	fdwCharSet   = HEBREW_CHARSET;
+            || (encoding == @symbol('ms-cp1255'))) {
+        fdwCharSet   = HEBREW_CHARSET;
     } else if ((encoding == @symbol('ms-arabic'))
-	    || (encoding == @symbol('ms-cp1256'))) {
-	fdwCharSet   = ARABIC_CHARSET;
+            || (encoding == @symbol('ms-cp1256'))) {
+        fdwCharSet   = ARABIC_CHARSET;
     } else if ((encoding == @symbol('ms-greek'))
-	    || (encoding == @symbol('ms-cp1253'))) {
-	fdwCharSet   = GREEK_CHARSET;
+            || (encoding == @symbol('ms-cp1253'))) {
+        fdwCharSet   = GREEK_CHARSET;
     } else if ((encoding == @symbol('ms-turkish'))
-	    || (encoding == @symbol('ms-cp1254'))) {
-	fdwCharSet   = TURKISH_CHARSET;
+            || (encoding == @symbol('ms-cp1254'))) {
+        fdwCharSet   = TURKISH_CHARSET;
     } else if ((encoding == @symbol('ms-russian'))
-	    || (encoding == @symbol('ms-cp1251'))) {
-	fdwCharSet   = RUSSIAN_CHARSET;
+            || (encoding == @symbol('ms-cp1251'))) {
+        fdwCharSet   = RUSSIAN_CHARSET;
     } else if ((encoding == @symbol('ms-easteurope'))
-	    || (encoding == @symbol('ms-cp1250'))) {
-	fdwCharSet   = EASTEUROPE_CHARSET;
+            || (encoding == @symbol('ms-cp1250'))) {
+        fdwCharSet   = EASTEUROPE_CHARSET;
     } else if ((encoding == @symbol('ms-baltic'))
-	    || (encoding == @symbol('ms-cp1257'))) {
-	fdwCharSet   = BALTIC_CHARSET;
+            || (encoding == @symbol('ms-cp1257'))) {
+        fdwCharSet   = BALTIC_CHARSET;
     } else if ((encoding == @symbol('ms-vietnamese'))) {
-	fdwCharSet   = VIETNAMESE_CHARSET;
+        fdwCharSet   = VIETNAMESE_CHARSET;
     } else if ((encoding == @symbol('ms-thai'))) {
-	fdwCharSet   = THAI_CHARSET;
+        fdwCharSet   = THAI_CHARSET;
     } else if ((encoding == @symbol('ms-mac'))) {
-	fdwCharSet   = MAC_CHARSET;
+        fdwCharSet   = MAC_CHARSET;
 #ifdef UNICODE_CHARSET
     } else if ((encoding == @symbol('ms-unicode'))) {
-	fdwCharSet   = UNICODE_CHARSET;
+        fdwCharSet   = UNICODE_CHARSET;
 #endif
     }
 
     if ( __isString( family ) ) {
-	work = __stringVal( family );
-	if (strcmp( work, "nil" ) != 0 ) {
-	    strncpy( faceName, work, sizeof(faceName)-1 );
-	}
+        work = __stringVal( family );
+        if (strcmp( work, "nil" ) != 0 ) {
+            strncpy( faceName, work, sizeof(faceName)-1 );
+        }
     }
 
     /* Q: should we allow those ? (they make ST/X programs less portable to X */
     if( __isString( weight ) ) {
-	work = __stringVal( weight );
-	if (strcmp( work, "bold" ) == 0 ) {
-	    fnWeight = FW_BOLD;
-	} else if (strcmp( work, "medium" ) == 0 ) {
-	    fnWeight = FW_MEDIUM;
-	} else if (strcmp( work, "normal" ) == 0 ) {
-	    fnWeight = FW_NORMAL;
-	} else if (strcmp( work, "light" ) == 0 ) {
-	    fnWeight = FW_LIGHT;
-	} else if (strcmp( work, "demi" ) == 0 ) {
-	    fnWeight = FW_LIGHT;
-	} else if (strcmp( work, "heavy" ) == 0 ) {
-	    fnWeight = FW_HEAVY;
-	} else if (strcmp( work, "extraBold" ) == 0 ) {
-	    fnWeight = FW_EXTRABOLD;
-	} else if (strcmp( work, "semiBold" ) == 0 ) {
-	    fnWeight = FW_SEMIBOLD;
-	} else if (strcmp( work, "thin" ) == 0 ) {
-	    fnWeight = FW_THIN;
-	} else if (strcmp( work, "extraLight" ) == 0 ) {
-	    fnWeight = FW_EXTRALIGHT;
-	}
+        work = __stringVal( weight );
+        if (strcmp( work, "bold" ) == 0 ) {
+            fnWeight = FW_BOLD;
+        } else if (strcmp( work, "medium" ) == 0 ) {
+            fnWeight = FW_MEDIUM;
+        } else if (strcmp( work, "normal" ) == 0 ) {
+            fnWeight = FW_NORMAL;
+        } else if (strcmp( work, "light" ) == 0 ) {
+            fnWeight = FW_LIGHT;
+        } else if (strcmp( work, "demi" ) == 0 ) {
+            fnWeight = FW_LIGHT;
+        } else if (strcmp( work, "heavy" ) == 0 ) {
+            fnWeight = FW_HEAVY;
+        } else if (strcmp( work, "extraBold" ) == 0 ) {
+            fnWeight = FW_EXTRABOLD;
+        } else if (strcmp( work, "semiBold" ) == 0 ) {
+            fnWeight = FW_SEMIBOLD;
+        } else if (strcmp( work, "thin" ) == 0 ) {
+            fnWeight = FW_THIN;
+        } else if (strcmp( work, "extraLight" ) == 0 ) {
+            fnWeight = FW_EXTRALIGHT;
+        }
     } else if (__isSmallInteger(weight)) {
-	fnWeight = __intVal(weight);
+        fnWeight = __intVal(weight);
     }
 
     if(__isSmallInteger( logSize )) {
-	nHeight = __intVal( logSize );
+        nHeight = __intVal( logSize );
     }
 
     if (__isString(slant)) {
-	work2 = __stringVal( slant );
-	work  = __stringVal( slant );
-
-	if (strncmp(work2, "italic", 6) == 0)  {
-	    fdwItalic = TRUE;
-	    if ( work2[6] == '-' )
-		strncpy( work, &work2[7], ( strlen( work2) - 7) );
-	} else {
-	    if (strncmp(work2, "oblique", 7) == 0)  {
-		fdwItalic = TRUE;
-		if ( work2[7] == '-' )
-		    strncpy( work, &work2[8], ( strlen( work2) - 8) );
-	    }
-	}
-	if (strncmp( work, "underline", 9 ) == 0 ) {
-	    fdwUnderline = TRUE;
-	    if( work[10] == '-' )
-		strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
-	}
-	if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
-	    fdwStrikeOut = TRUE;
-	}
+        work2 = __stringVal( slant );
+        work  = __stringVal( slant );
+
+        if (strncmp(work2, "italic", 6) == 0)  {
+            fdwItalic = TRUE;
+            if ( work2[6] == '-' )
+                strncpy( work, &work2[7], ( strlen( work2) - 7) );
+        } else {
+            if (strncmp(work2, "oblique", 7) == 0)  {
+                fdwItalic = TRUE;
+                if ( work2[7] == '-' )
+                    strncpy( work, &work2[8], ( strlen( work2) - 8) );
+            }
+        }
+        if (strncmp( work, "underline", 9 ) == 0 ) {
+            fdwUnderline = TRUE;
+            if( work[10] == '-' )
+                strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
+        }
+        if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
+            fdwStrikeOut = TRUE;
+        }
     }
 
     DPRINTF(("CreateFont face:%s h=%d w=%d wght=%d\n",
-		faceName, nHeight, nWidth, fnWeight));
+                faceName, nHeight, nWidth, fnWeight));
 
     hFont = CreateFont( -nHeight,   /* character height - not cell height */
-			nWidth,
-			nEscapement,
-			nOrientation,
-			fnWeight,
-			fdwItalic,
-			fdwUnderline,
-			fdwStrikeOut,
-			fdwCharSet,
-			fdwOutputPrecision,
-			fdwClipPrecision,
-			fdwQuality,
-			fdwPitchAndFamily,
-			faceName );
+                        nWidth,
+                        nEscapement,
+                        nOrientation,
+                        fnWeight,
+                        fdwItalic,
+                        fdwUnderline,
+                        fdwStrikeOut,
+                        fdwCharSet,
+                        fdwOutputPrecision,
+                        fdwClipPrecision,
+                        fdwQuality,
+                        fdwPitchAndFamily,
+                        faceName );
 
     if (hFont != NULL) {
-	DPRINTF(("createFont: %x\n", hFont));
+        DPRINTF(("createFont: %x\n", hFont));
 /*
     #ifdef COUNT_RESOURCES
-	__cnt_font++;
-	RES1PRINTF(("CreateFont %d\n", __cnt_font));
+        __cnt_font++;
+        RES1PRINTF(("CreateFont %d\n", __cnt_font));
     #endif
 */
-	RETURN ( __MKOBJ(hFont) );
+        RETURN ( __MKEXTERNALADDRESS(hFont) );
     }
 
     DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
@@ -4551,14 +4551,14 @@
 
     "
      Display getFontWithFoundry:'*'
-			 family:'courier'
-			 weight:'medium'
-			  slant:'r'
-			spacing:nil
-		      pixelSize:nil
-			   size:13
-		       registry:'iso8859'
-		       encoding:'*'
+                         family:'courier'
+                         weight:'medium'
+                          slant:'r'
+                        spacing:nil
+                      pixelSize:nil
+                           size:13
+                       registry:'iso8859'
+                       encoding:'*'
     "
 
     "new NT Version: 20.2.1997 / 22:33:29 / dq"
@@ -5067,10 +5067,10 @@
    //     memBM = CreateCompatibleBitmap ( compatibleDC, bitmap.bmWidth, bitmap.bmHeight );
    //     SelectObject ( compatibleDC, memBM );
 
-        RETURN (__MKOBJ(compatibleDC));
+        RETURN (__MKEXTERNALADDRESS(compatibleDC));
 
 /*
-        RETURN ( __MKOBJ(gcData) );
+        RETURN ( __MKEXTERNALADDRESS(gcData) );
 */
     }
     RETURN (nil);
@@ -6040,5 +6040,9 @@
 !WinPrinterContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/WinPrinterContext.st,v 1.37 2009-03-30 13:50:32 sr Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/WinPrinterContext.st,v 1.38 2010-02-01 18:17:08 stefan Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libview2/WinPrinterContext.st,v 1.38 2010-02-01 18:17:08 stefan Exp $'
 ! !