Changeset 158:de2578a843a7

Show
Ignore:
Timestamp:
02/09/08 22:19:19 (8 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Tango update to rev 3158, TracedException?>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem? Thanx to nascent for the report.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • README

    r118 r158  
    44Runtime     : Tango SVN trunk rev. 3071 
    55DSSS        : 0.73 
     6Tango       : svn rev 3158 
    67 
    78Note: DSSS has by default the feature active to compile one file a time. 
  • dsss.conf

    r153 r158  
    11[dwt] 
    22type=library 
     3buildflags+=-g -gc -debug 
    34 
  • dwt/DWT.d

    r153 r158  
    35403540 * @see IllegalArgumentException 
    35413541 */ 
    3542 public static void error (int code, TracedException throwable) { 
     3542public static void error (int code, Exception throwable) { 
    35433543    error (code, throwable, null); 
    35443544} 
     
    35723572 * @since 3.0 
    35733573 */ 
    3574 public static void error (int code, TracedException throwable, char[] detail) { 
     3574public static void error (int code, Exception throwable, char[] detail) { 
    35753575 
    35763576    /* 
  • dwt/DWTError.d

    r72 r158  
    5454     * or null if this information is not available. 
    5555     */ 
    56     public TracedException throwable; 
     56    public Exception throwable; 
    5757 
    5858    //static final long serialVersionUID = 3833467327105808433L; 
     
    143143public void printStackTrace () { 
    144144    Stderr.formatln( "stacktrace follows (if feature compiled in)" ); 
    145     foreach( msg; this ){ 
     145    foreach( msg; info ){ 
    146146        Stderr.formatln( "{}", msg ); 
    147147    } 
    148148    if ( throwable !is null) { 
    149149        Stderr.formatln ("*** Stack trace of contained error ***"); //$NON-NLS-1$ 
    150         foreach( msg; throwable ){ 
     150        foreach( msg; throwable.info ){ 
    151151            Stderr.formatln( "{}", msg ); 
    152152        } 
  • dwt/DWTException.d

    r72 r158  
    3535 */ 
    3636 
    37 public class DWTException : TracedException { 
     37public class DWTException : Exception { 
    3838    /** 
    3939     * The DWT error code, one of DWT.ERROR_*. 
     
    4545     * or null if this information is not available. 
    4646     */ 
    47     public TracedException throwable; 
     47    public Exception throwable; 
    4848 
    4949    //static final long serialVersionUID = 3257282552304842547L; 
     
    106106 * @since 3.1 
    107107 */ 
    108 public TracedException getCause() { 
     108public Exception getCause() { 
    109109    return throwable; 
    110110} 
     
    133133public void printStackTrace () { 
    134134    Stderr.formatln( "stacktrace follows (if feature compiled in)" ); 
    135     foreach( msg; this ){ 
     135    foreach( msg; info ){ 
    136136        Stderr.formatln( "{}", msg ); 
    137137    } 
    138138    if ( throwable !is null) { 
    139139        Stderr.formatln ("*** Stack trace of contained exception ***"); //$NON-NLS-1$ 
    140         foreach( msg; throwable ){ 
     140        foreach( msg; throwable.info ){ 
    141141            Stderr.formatln( "{}", msg ); 
    142142        } 
  • dwt/accessibility/AccessibleFactory.d

    r140 r158  
    9797    private this (int /*long*/ widgetType) { 
    9898        widgetTypeName = OS.g_type_name (widgetType); 
    99         char[] factoryName = FACTORY_TYPENAME ~ fromUtf8z( widgetTypeName ) ~ \0; 
     99        char[] factoryName = FACTORY_TYPENAME ~ fromStringz( widgetTypeName ) ~ \0; 
    100100        if (OS.g_type_from_name (factoryName.ptr) is 0) { 
    101101            /* register the factory */ 
     
    139139                    return accessible.accessibleObject.handle; 
    140140                } 
    141                 char[] buffer = fromUtf8z( widgetTypeName ).dup; 
     141                char[] buffer = fromStringz( widgetTypeName ).dup; 
    142142                auto type = getType (buffer, accessible, objectParentType, ACC.CHILDID_SELF); 
    143143                AccessibleObject object = new AccessibleObject (type, cast(GtkWidget*)widget, accessible, objectParentType, false); 
  • dwt/accessibility/AccessibleObject.d

    r104 r158  
    102102        event.childID = object.id; 
    103103        if (parentResult !is null) { 
    104             char[] res = fromUtf8z( parentResult ); 
     104            char[] res = fromStringz( parentResult ); 
    105105            event.result = res.dup; 
    106106        } 
     
    134134        event.childID = object.id; 
    135135        if (parentResult !is null) { 
    136             char[] res = fromUtf8z( parentResult ); 
     136            char[] res = fromStringz( parentResult ); 
    137137            event.result = res.dup; 
    138138        } 
     
    360360        event.childID = object.id; 
    361361        if (parentResult !is null) { 
    362             event.result = fromUtf8z( parentResult ).dup; 
     362            event.result = fromStringz( parentResult ).dup; 
    363363        } 
    364364        for (int i = 0; i < listeners.length; i++) { 
     
    388388        event.childID = object.id; 
    389389        if (parentResult !is null) { 
    390             event.result = fromUtf8z( parentResult ).dup; 
     390            event.result = fromStringz( parentResult ).dup; 
    391391        } 
    392392        for (int i = 0; i < listeners.length; i++) { 
     
    12051205                parentResult = textIface.get_text( handle, 0, characterCount); 
    12061206                if (parentResult !is null) { 
    1207                     parentText = fromUtf8z( parentResult ).dup; 
     1207                    parentText = fromStringz( parentResult ).dup; 
    12081208                } 
    12091209            } 
  • dwt/dnd/Clipboard.d

    r146 r158  
    564564            continue; 
    565565        } 
    566         char[] buffer = tango.stdc.stringz.fromUtf8z( pName ).dup; 
     566        char[] buffer = tango.stdc.stringz.fromStringz( pName ).dup; 
    567567        OS.g_free (pName); 
    568568        result[count++] = "GTKCLIPBOARD "~buffer; 
     
    573573            continue; 
    574574        } 
    575         char[] buffer = tango.stdc.stringz.fromUtf8z( pName ).dup; 
     575        char[] buffer = tango.stdc.stringz.fromStringz( pName ).dup; 
    576576        OS.g_free (pName); 
    577577        result[count++] = "GTKPRIMARYCLIPBOARD "~buffer; 
  • dwt/dnd/FileTransfer.d

    r152 r158  
    9090        OS.g_free(localePtr); 
    9191        if (error !is null || uriPtr is null) continue; 
    92         char[] temp = tango.stdc.stringz.fromUtf8z( uriPtr ).dup; 
     92        char[] temp = tango.stdc.stringz.fromStringz( uriPtr ).dup; 
    9393        OS.g_free(uriPtr); 
    9494        int newLength = (i > 0) ? buffer.length+separator.length+temp.length :  temp.length; 
     
    163163        OS.g_free(localePtr); 
    164164        if (error !is null || utf8Ptr is null) continue; 
    165         char[] buffer = tango.stdc.stringz.fromUtf8z( utf8Ptr ).dup; 
     165        char[] buffer = tango.stdc.stringz.fromStringz( utf8Ptr ).dup; 
    166166        OS.g_free(utf8Ptr); 
    167167        char[] name = buffer; 
  • dwt/dnd/TextTransfer.d

    r152 r158  
    131131    int count = OS.gdk_text_property_to_utf8_list(transferData.type, transferData.format, transferData.pValue, transferData.length, &list); 
    132132    if (count is 0) return null; 
    133     char[] utf8 = tango.stdc.stringz.fromUtf8z( list[0] ).dup; 
     133    char[] utf8 = tango.stdc.stringz.fromStringz( list[0] ).dup; 
    134134    OS.g_strfreev(list); 
    135135    return new ArrayWrapperString( utf8 ); 
  • dwt/dwthelper/Integer.d

    r13 r158  
    1 /** 
     1/** 
    22 * Authors: Frank Benoit <keinfarbton@googlemail.com> 
    33 */ 
     
    88 
    99static import tango.text.convert.Integer; 
     10private import tango.core.Exception; 
    1011 
     12public final class Byte { 
     13    public static byte parseByte( char[] s ){ 
     14        try{ 
     15            int res = tango.text.convert.Integer.parse( s ); 
     16            if( res < byte.min || res > byte.max ){ 
     17                throw new NumberFormatException( "out of range" ); 
     18            } 
     19            return res; 
     20        } 
     21        catch( IllegalArgumentException e ){ 
     22            throw new NumberFormatException( e ); 
     23        } 
     24    } 
     25} 
    1126public final class Integer { 
    1227 
     
    5671 
    5772    public static int parseInt( char[] s, int radix ){ 
    58         return tango.text.convert.Integer.parse( s, cast(uint)radix ); 
     73        try{ 
     74            return tango.text.convert.Integer.parse( s, cast(uint)radix ); 
     75        } 
     76        catch( IllegalArgumentException e ){ 
     77            throw new NumberFormatException( e ); 
     78        } 
    5979    } 
    6080 
    6181    public static int parseInt( char[] s ){ 
    62         return tango.text.convert.Integer.parse( s ); 
     82        try{ 
     83            return tango.text.convert.Integer.parse( s ); 
     84        } 
     85        catch( IllegalArgumentException e ){ 
     86            throw new NumberFormatException( e ); 
     87        } 
    6388    } 
    6489 
  • dwt/dwthelper/System.d

    r150 r158  
    66import tango.core.Exception; 
    77import tango.time.Clock; 
     8import tango.stdc.stdlib : exit; 
    89 
    910template SimpleType(T) { 
     
    125126    } 
    126127 
     128    static void exit( int code ){ 
     129        .exit(code); 
     130    } 
     131 
    127132} 
    128133 
  • dwt/dwthelper/utils.d

    r109 r158  
    55 
    66public import dwt.dwthelper.System; 
     7public import Math = tango.math.Math; 
    78 
    89import tango.io.Stdout; 
     10import tango.stdc.stringz; 
     11static import tango.text.Util; 
    912import tango.text.Unicode; 
     13import tango.text.convert.Utf; 
     14import tango.core.Exception; 
    1015import tango.stdc.stdlib : exit; 
    1116 
     
    1823abstract class ArrayWrapper{ 
    1924} 
     25abstract class ValueWrapper{ 
     26} 
    2027 
    2128class ArrayWrapperT(T) : ArrayWrapper { 
     
    2633} 
    2734 
     35class ValueWrapperT(T) : ValueWrapper { 
     36    public T value; 
     37    public this( T data ){ 
     38        value = data; 
     39    } 
     40} 
     41 
     42alias ValueWrapperT!(bool)    ValueWrapperBool; 
    2843alias ArrayWrapperT!(byte)    ArrayWrapperByte; 
    2944alias ArrayWrapperT!(int)     ArrayWrapperInt; 
     
    4560    return r[0]; 
    4661} 
     62bool CharacterIsWhitespace( dchar c ){ 
     63    return tango.text.Unicode.isWhitespace( c ); 
     64} 
     65bool CharacterIsDigit( dchar c ){ 
     66    return tango.text.Unicode.isDigit( c ); 
     67} 
    4768 
     69public int indexOf( char[] str, char searched ){ 
     70    int res = tango.text.Util.locate( str, searched ); 
     71    if( res is str.length ) res = -1; 
     72    return res; 
     73} 
     74 
     75public int indexOf( char[] str, char searched, int startpos ){ 
     76    int res = tango.text.Util.locate( str, searched, startpos ); 
     77    if( res is str.length ) res = -1; 
     78    return res; 
     79} 
     80 
     81public int indexOf(char[] str, char[] ch){ 
     82    return indexOf( str, ch, 0 ); 
     83} 
     84 
     85public int indexOf(char[] str, char[] ch, int start){ 
     86    int res = tango.text.Util.locatePattern( str, ch, start ); 
     87    if( res is str.length ) res = -1; 
     88    return res; 
     89} 
     90 
     91public char[] substring( char[] str, int start ){ 
     92    return str[ start .. $ ].dup; 
     93} 
     94 
     95public char[] substring( char[] str, int start, int end ){ 
     96    return str[ start .. end ].dup; 
     97} 
     98 
     99public wchar[] substring( wchar[] str, int start ){ 
     100    return str[ start .. $ ].dup; 
     101} 
     102 
     103public wchar[] substring( wchar[] str, int start, int end ){ 
     104    return str[ start .. end ].dup; 
     105} 
     106 
     107public char charAt( char[] str, int pos ){ 
     108    return str[ pos ]; 
     109} 
     110 
     111public void getChars( char[] src, int srcBegin, int srcEnd, char[] dst, int dstBegin){ 
     112    dst[ dstBegin .. dstBegin + srcEnd - srcBegin ] = src[ srcBegin .. srcEnd ]; 
     113} 
     114 
     115public wchar[] toCharArray( char[] str ){ 
     116    return toString16( str ); 
     117} 
     118 
     119public bool endsWith( char[] src, char[] pattern ){ 
     120    if( src.length < pattern.length ){ 
     121        return false; 
     122    } 
     123    return src[ $-pattern.length .. $ ] == pattern; 
     124} 
     125 
     126public bool equals( char[] src, char[] other ){ 
     127    return src == other; 
     128} 
     129 
     130public char[] toLowerCase( char[] src ){ 
     131    return tango.text.Unicode.toLower( src ); 
     132} 
     133 
     134static char[] toHex(uint value, bool prefix = true, int radix = 8){ 
     135    return tango.text.convert.Integer.toString( 
     136            value, 
     137            radix is 10 ? tango.text.convert.Integer.Style.Signed : 
     138            radix is  8 ? tango.text.convert.Integer.Style.Octal  : 
     139            radix is 16 ? tango.text.convert.Integer.Style.Hex    : 
     140                          tango.text.convert.Integer.Style.Signed, 
     141            prefix ? tango.text.convert.Integer.Flags.Prefix : tango.text.convert.Integer.Flags.None 
     142            ); 
     143} 
     144 
     145class NumberFormatException : IllegalArgumentException { 
     146    this( char[] e ){ 
     147        super(e); 
     148    } 
     149    this( Exception e ){ 
     150        super(e.toString); 
     151    } 
     152} 
     153 
     154private struct GCStats { 
     155    size_t poolsize;        // total size of pool 
     156    size_t usedsize;        // bytes allocated 
     157    size_t freeblocks;      // number of blocks marked FREE 
     158    size_t freelistsize;    // total of memory on free lists 
     159    size_t pageblocks;      // number of blocks marked PAGE 
     160} 
     161private extern(C) GCStats gc_stats(); 
     162 
     163size_t RuntimeTotalMemory(){ 
     164    GCStats s;// = gc_stats(); 
     165    return s.poolsize; 
     166} 
     167 
     168 
     169 
     170 
  • dwt/graphics/Device.d

    r104 r158  
    5555    bool debugging; 
    5656    bool tracking; 
    57     TracedException [] errors; 
     57    Exception [] errors; 
    5858    Object [] objects; 
    5959 
     
    169169        } 
    170170        if (tracking) { 
    171             errors = new TracedException [128]; 
     171            errors = new Exception [128]; 
    172172            objects = new Object [128]; 
    173173        } 
     
    331331    int index = 0; 
    332332    data.objects = new Object [count]; 
    333     data.errors = new TracedException [count]; 
     333    data.errors = new Exception [count]; 
    334334    for (int i=0; i<length; i++) { 
    335335        if (objects [i] !is null) { 
     
    423423        if (faceName !is null) { 
    424424            auto familyName = OS.pango_font_family_get_name(family); 
    425             match = Compatibility.equalsIgnoreCase(faceName, fromUtf8z( familyName )); 
     425            match = Compatibility.equalsIgnoreCase(faceName, fromStringz( familyName )); 
    426426        } 
    427427        if (match) { 
     
    683683    if (dev.warningLevel is 0) { 
    684684        if (DEBUG || dev.debugging) { 
    685             foreach( msg; new TracedException ("") ){ 
     685            foreach( msg; (new Exception ("")).info ){ 
    686686                Stderr.formatln( "trc {}", msg ); 
    687687            } 
     
    696696        if (objects [i] is null) { 
    697697            objects [i] = object; 
    698             errors [i] = new TracedException (""); 
     698            errors [i] = new Exception (""); 
    699699            return; 
    700700        } 
     
    704704    newObjects [objects.length] = object; 
    705705    objects = newObjects; 
    706     TracedException [] newErrors = new TracedException [errors.length + 128]; 
     706    Exception [] newErrors = new Exception [errors.length + 128]; 
    707707    System.arraycopy (errors, 0, newErrors, 0, errors.length); 
    708     newErrors [errors.length] = new TracedException (""); 
     708    newErrors [errors.length] = new Exception (""); 
    709709    errors = newErrors; 
    710710} 
     
    825825        if (device.warningLevel is 0) { 
    826826            if (DEBUG || device.debugging) { 
    827                 foreach( msg; new TracedException ("") ){ 
     827                foreach( msg; (new Exception ("")).info ){ 
    828828                    Stderr.formatln( "trc {}", msg ); 
    829829                } 
     
    844844    if (device !is null) { 
    845845        if (DEBUG || device.debugging) { 
    846             foreach( msg; new TracedException ("") ){ 
     846            foreach( msg; (new Exception ("")).info ){ 
    847847                Stderr.formatln( "trc {}", msg ); 
    848848            } 
     
    850850    } else { 
    851851        if (DEBUG) { 
    852             foreach( msg; new TracedException ("") ){ 
     852            foreach( msg; (new Exception ("")).info ){ 
    853853                Stderr.formatln( "trc {}", msg ); 
    854854            } 
  • dwt/graphics/DeviceData.d

    r72 r158  
    3535    public bool debugging; 
    3636    public bool tracking; 
    37     public TracedException [] errors; 
     37    public Exception [] errors; 
    3838    public Object [] objects; 
    3939} 
  • dwt/graphics/Font.d

    r150 r158  
    200200 
    201201    auto family = OS.pango_font_description_get_family(handle); 
    202     char[] name = fromUtf8z( family ); 
     202    char[] name = fromStringz( family ); 
    203203    float height = cast(float)OS.pango_font_description_get_size(handle) / OS.PANGO_SCALE; 
    204204    int pangoStyle = OS.pango_font_description_get_style(handle); 
     
    209209    if (pangoWeight >= OS.PANGO_WEIGHT_BOLD) style |= DWT.BOLD; 
    210210    auto fontString = OS.pango_font_description_to_string (handle); 
    211     auto buffer = fromUtf8z( fontString ).dup; 
     211    auto buffer = fromStringz( fontString ).dup; 
    212212    FontData data = new FontData( buffer , height, style); 
    213213    OS.g_free (fontString); 
  • dwt/graphics/ImageData.d

    r104 r158  
    229229            for (int b = 0; b < 9; ++b) { 
    230230                byte[] data = ANY_TO_EIGHT[b] = new byte[1 << b]; 
    231                 if (b == 0) continue; 
     231                if (b is 0) continue; 
    232232                int inc = 0; 
    233                 for (int bit = 0x10000; (bit >>= b) != 0;) inc |= bit; 
     233                for (int bit = 0x10000; (bit >>= b) !is 0;) inc |= bit; 
    234234                for (int v = 0, p = 0; v < 0x10000; v+= inc) data[p++] = cast(byte)(v >> 8); 
    235235            } 
     
    317317 *     static ImageData loadImageData (Class clazz, String string) { 
    318318 *          InputStream stream = clazz.getResourceAsStream (string); 
    319  *          if (stream == null) return null; 
     319 *          if (stream is null) return null; 
    320320 *          ImageData imageData = null; 
    321321 *          try { 
     
    432432    int x, int y, int disposalMethod, int delayTime) 
    433433{ 
    434     if (palette == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    435     if (!(depth == 1 || depth == 2 || depth == 4 || depth ==
    436         || depth == 16 || depth == 24 || depth == 32)) { 
     434    if (palette is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     435    if (!(depth is 1 || depth is 2 || depth is 4 || depth is
     436        || depth is 16 || depth is 24 || depth is 32)) { 
    437437        DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    438438    } 
     
    440440        DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    441441    } 
    442     if (scanlinePad == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); 
     442    if (scanlinePad is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); 
    443443 
    444444    int bytesPerLine = (((width * depth + 7) / 8) + (scanlinePad - 1)) 
     
    450450        scanlinePad, 
    451451        bytesPerLine, 
    452         data != null ? data : new byte[bytesPerLine * height], 
     452        data !is null ? data : new byte[bytesPerLine * height], 
    453453        palette, 
    454454        transparentPixel, 
     
    530530        getPixels(0, y, width, row, 0); 
    531531        for (int i = 0; i < width; i++) { 
    532             if (pixel != -1 && row[i] == pixel) { 
     532            if (pixel !is -1 && row[i] is pixel) { 
    533533                row[i] = 0; 
    534534            } else { 
     
    542542 
    543543static byte[] checkData(byte [] data) { 
    544     if (data == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     544    if (data is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    545545    return data; 
    546546} 
     
    558558    System.arraycopy(data, 0, cloneData, 0, data.length); 
    559559    byte[] cloneMaskData = null; 
    560     if (maskData != null) { 
     560    if (maskData !is null) { 
    561561        cloneMaskData = new byte[maskData.length]; 
    562562        System.arraycopy(maskData, 0, cloneMaskData, 0, maskData.length); 
    563563    } 
    564564    byte[] cloneAlphaData = null; 
    565     if (alphaData != null) { 
     565    if (alphaData !is null) { 
    566566        cloneAlphaData = new byte[alphaData.length]; 
    567567        System.arraycopy(alphaData, 0, cloneAlphaData, 0, alphaData.length); 
     
    601601    if (x >= width || y >= height || x < 0 || y < 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    602602 
    603     if (alphaData == null) return 255; 
     603    if (alphaData is null) return 255; 
    604604    return alphaData[y * width + x] & 0xFF; 
    605605} 
     
    624624 */ 
    625625public void getAlphas(int x, int y, int getWidth, byte[] alphas, int startIndex) { 
    626     if (alphas == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     626    if (alphas is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    627627    if (getWidth < 0 || x >= width || y >= height || x < 0 || y < 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    628     if (getWidth == 0) return; 
    629  
    630     if (alphaData == null) { 
     628    if (getWidth is 0) return; 
     629 
     630    if (alphaData is null) { 
    631631        int endIndex = startIndex + getWidth; 
    632632        for (int i = startIndex; i < endIndex; i++) { 
     
    677677            index = (y * bytesPerLine) + (x >> 1); 
    678678            theByte = data[index] & 0xFF; 
    679             if ((x & 0x1) == 0) { 
     679            if ((x & 0x1) is 0) { 
    680680                return theByte >> 4; 
    681681            } else { 
     
    692692            theByte = data[index] & 0xFF; 
    693693            mask = 1 << (7 - (x & 0x7)); 
    694             if ((theByte & mask) == 0) { 
     694            if ((theByte & mask) is 0) { 
    695695                return 0; 
    696696            } else { 
     
    726726 */ 
    727727public void getPixels(int x, int y, int getWidth, byte[] pixels, int startIndex) { 
    728     if (pixels == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     728    if (pixels is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    729729    if (getWidth < 0 || x >= width || y >= height || x < 0 || y < 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    730     if (getWidth == 0) return; 
     730    if (getWidth is 0) return; 
    731731    int index; 
    732732    int theByte; 
     
    753753        case 4: 
    754754            index = (y * bytesPerLine) + (x >> 1); 
    755             if ((x & 0x1) == 1) { 
     755            if ((x & 0x1) is 1) { 
    756756                theByte = data[index] & 0xFF; 
    757757                pixels[i] = cast(byte)(theByte & 0x0F); 
     
    813813                    srcX = 0; 
    814814                } else { 
    815                     if (offset == 0) { 
     815                    if (offset is 0) { 
    816816                        index++; 
    817817                        theByte = data[index] & 0xFF; 
     
    825825            while (n > 0) { 
    826826                mask = 1 << (7 - (srcX & 0x7)); 
    827                 if ((theByte & mask) == 0) { 
     827                if ((theByte & mask) is 0) { 
    828828                    pixels[i] = 0; 
    829829                } else { 
     
    839839                    srcX = 0; 
    840840                } else { 
    841                     if (mask == 1) { 
     841                    if (mask is 1) { 
    842842                        index++; 
    843843                        if (n > 0) theByte = data[index] & 0xFF; 
     
    873873 */ 
    874874public void getPixels(int x, int y, int getWidth, int[] pixels, int startIndex) { 
    875     if (pixels == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     875    if (pixels is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    876876    if (getWidth < 0 || x >= width || y >= height || x < 0 || y < 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    877     if (getWidth == 0) return; 
     877    if (getWidth is 0) return; 
    878878    int index; 
    879879    int theByte; 
     
    948948        case 4: 
    949949            index = (y * bytesPerLine) + (x >> 1); 
    950             if ((x & 0x1) == 1) { 
     950            if ((x & 0x1) is 1) { 
    951951                theByte = data[index] & 0xFF; 
    952952                pixels[i] = theByte & 0x0F; 
     
    10081008                    srcX = 0; 
    10091009                } else { 
    1010                     if (offset == 0) { 
     1010                    if (offset is 0) { 
    10111011                        index++; 
    10121012                        theByte = data[index] & 0xFF; 
     
    10201020            while (n > 0) { 
    10211021                mask = 1 << (7 - (srcX & 0x7)); 
    1022                 if ((theByte & mask) == 0) { 
     1022                if ((theByte & mask) is 0) { 
    10231023                    pixels[i] = 0; 
    10241024                } else { 
     
    10341034                    srcX = 0; 
    10351035                } else { 
    1036                     if (mask == 1) { 
     1036                    if (mask is 1) { 
    10371037                        index++; 
    10381038                        if (n > 0) theByte = data[index] & 0xFF; 
     
    10681068 */ 
    10691069public ImageData getTransparencyMask() { 
    1070     if (getTransparencyType() == DWT.TRANSPARENCY_MASK) { 
     1070    if (getTransparencyType() is DWT.TRANSPARENCY_MASK) { 
    10711071        return new ImageData(width, height, 1, bwPalette(), maskPad, maskData); 
    10721072    } else { 
     
    10831083 */ 
    10841084public int getTransparencyType() { 
    1085     if (maskData != null) return DWT.TRANSPARENCY_MASK; 
    1086     if (transparentPixel != -1) return DWT.TRANSPARENCY_PIXEL; 
    1087     if (alphaData != null) return DWT.TRANSPARENCY_ALPHA; 
     1085    if (maskData !is null) return DWT.TRANSPARENCY_MASK; 
     1086    if (transparentPixel !is -1) return DWT.TRANSPARENCY_PIXEL; 
     1087    if (alphaData !is null) return DWT.TRANSPARENCY_ALPHA; 
    10881088    return DWT.TRANSPARENCY_NONE; 
    10891089} 
     
    10951095 */ 
    10961096int getByteOrder() { 
    1097     return depth != 16 ? MSB_FIRST : LSB_FIRST; 
     1097    return depth !is 16 ? MSB_FIRST : LSB_FIRST; 
    10981098} 
    10991099 
     
    11341134 
    11351135    /* Scale the image mask or alpha */ 
    1136     if (maskData != null) { 
     1136    if (maskData !is null) { 
    11371137        dest.maskPad = this.maskPad; 
    11381138        int destBpl = (dest.width + 7) / 8; 
     
    11461146            dest.maskData, 1, destBpl, MSB_FIRST, 0, 0, dest.width, dest.height, null, null, null, 
    11471147            flipX, flipY); 
    1148     } else if (alpha != -1) { 
     1148    } else if (alpha !is -1) { 
    11491149        dest.alpha = this.alpha; 
    1150     } else if (alphaData != null) { 
     1150    } else if (alphaData !is null) { 
    11511151        dest.alphaData = new byte[dest.width * dest.height]; 
    11521152        blit(BLIT_SRC, 
     
    11751175        DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    11761176 
    1177     if (alphaData == null) alphaData = new byte[width * height]; 
     1177    if (alphaData is null) alphaData = new byte[width * height]; 
    11781178    alphaData[y * width + x] = cast(byte)alpha; 
    11791179} 
     
    11991199 */ 
    12001200public void setAlphas(int x, int y, int putWidth, byte[] alphas, int startIndex) { 
    1201     if (alphas == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     1201    if (alphas is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    12021202    if (putWidth < 0 || x >= width || y >= height || x < 0 || y < 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    1203     if (putWidth == 0) return; 
    1204  
    1205     if (alphaData == null) alphaData = new byte[width * height]; 
     1203    if (putWidth is 0) return; 
     1204 
     1205    if (alphaData is null) alphaData = new byte[width * height]; 
    12061206    // may throw an IndexOutOfBoundsException 
    12071207    System.arraycopy(alphas, startIndex, alphaData, y * width + x, putWidth); 
     
    12531253        case 4: 
    12541254            index = (y * bytesPerLine) + (x >> 1); 
    1255             if ((x & 0x1) == 0) { 
     1255            if ((x & 0x1) is 0) { 
    12561256                data[index] = cast(byte)((data[index] & 0x0F) | ((pixelValue & 0x0F) << 4)); 
    12571257            } else { 
     
    12701270            theByte = data[index]; 
    12711271            mask = 1 << (7 - (x & 0x7)); 
    1272             if ((pixelValue & 0x1) == 1) { 
     1272            if ((pixelValue & 0x1) is 1) { 
    12731273                data[index] = cast(byte)(theByte | mask); 
    12741274            } else { 
     
    13051305 */ 
    13061306public void setPixels(int x, int y, int putWidth, byte[] pixels, int startIndex) { 
    1307     if (pixels == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     1307    if (pixels is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    13081308    if (putWidth < 0 || x >= width || y >= height || x < 0 || y < 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    1309     if (putWidth == 0) return; 
     1309    if (putWidth is 0) return; 
    13101310    int index; 
    13111311    int theByte; 
     
    13321332        case 4: 
    13331333            index = (y * bytesPerLine) + (x >> 1); 
    1334             bool high = (x & 0x1) == 0; 
     1334            bool high = (x & 0x1) is 0; 
    13351335            while (n > 0) { 
    13361336                theByte = pix