Changeset 197:184ab53b7785

Show
Ignore:
Timestamp:
04/10/08 05:19:49 (6 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Changes and fixes for jface

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/custom/BusyIndicator.d

    r155 r197  
    1919import dwt.widgets.Display; 
    2020import dwt.widgets.Shell; 
    21 import dwt.dwthelper.Integer
     21import dwt.dwthelper.utils
    2222import dwt.dwthelper.Runnable; 
    2323 
  • dwt/custom/CTabFolder.d

    r178 r197  
    5050 
    5151import dwt.dwthelper.utils; 
    52 import dwt.dwthelper.Integer; 
    5352import tango.util.Convert; 
    5453static import tango.text.convert.Utf; 
  • dwt/custom/StyledText.d

    r178 r197  
    466466        } 
    467467    } 
    468     void init() { 
     468    void init_() { 
    469469        Rectangle trim = printer.computeTrim(0, 0, 0, 0); 
    470470        Point dpi = printer.getDPI(); 
     
    695695        } 
    696696        if (printer.startJob(jobName)) { 
    697             init(); 
     697            init_(); 
    698698            print(); 
    699699            dispose(); 
  • dwt/dnd/HTMLTransfer.d

    r140 r197  
    2121import dwt.dnd.DND; 
    2222 
    23 import dwt.dwthelper.Integer; 
    2423import dwt.dwthelper.utils; 
    2524static import tango.text.Text; 
  • dwt/dnd/RTFTransfer.d

    r141 r197  
    2121import dwt.dnd.DND; 
    2222 
    23 import dwt.dwthelper.Integer; 
    2423import dwt.dwthelper.utils; 
    2524static import tango.text.Text; 
  • dwt/dnd/TextTransfer.d

    r158 r197  
    2121import dwt.dnd.DND; 
    2222 
    23 import dwt.dwthelper.Integer; 
    2423import dwt.dwthelper.utils; 
    2524static import tango.text.Text; 
  • dwt/dnd/URLTransfer.d

    r145 r197  
    2323import dwt.dnd.DND; 
    2424 
    25 import dwt.dwthelper.Integer; 
    2625import dwt.dwthelper.utils; 
    2726static import tango.text.Text; 
  • dwt/dwthelper/BufferedInputStream.d

    r0 r197  
    5151        pos = 0; 
    5252        count = 0; 
    53         int count = getAndCheckIstr().read( buf ); 
     53        count = getAndCheckIstr().read( buf ); 
    5454        if( count < 0 ){ 
    5555            count = 0; 
  • dwt/dwthelper/ResourceBundle.d

    r124 r197  
    77import tango.io.Stdout; 
    88 
     9import dwt.DWT; 
     10import dwt.dwthelper.utils; 
    911 
    1012class ResourceBundle { 
     
    3537            //tango.io.Stdout.Stdout.formatln( "properties put {} startline", __LINE__ ); 
    3638            readLine(); 
    37             line = line.trim(); 
     39            line = dwt.dwthelper.utils.trim(line); 
    3840            if( line.length is 0 ){ 
    3941                //tango.io.Stdout.Stdout.formatln( "properties put {} was 0 length", __LINE__ ); 
     
    6264                    case 'n': c = '\n'; break; 
    6365                    case '\\': c = '\\'; break; 
     66                    case '\"': c = '\"'; break; 
    6467                    default: break; 
    6568                    } 
     
    9093            } 
    9194            if( iskeypart ){ 
    92                 //tango.io.Stdout.Stdout.formatln( "dwt.dwthelper.ResourceBundle ctor cannot find '='." ); 
     95                // Cannot find '=' in record 
     96                DWT.error( __FILE__, __LINE__, DWT.ERROR_INVALID_ARGUMENT ); 
    9397                continue; 
    9498            } 
    95             key = key.trim(); 
    96             value = value.trim(); 
     99            key = dwt.dwthelper.utils.trim(key); 
     100            value = dwt.dwthelper.utils.trim(value); 
    97101            //tango.io.Stdout.Stdout.formatln( "properties put {}=>{}", key, value ); 
    98102 
     
    110114            return (*v).dup; 
    111115        } 
    112         return key; 
     116        throw new MissingResourceException( "key not found", this.classinfo.name, key ); 
     117    } 
     118 
     119    public char[][] getKeys(){ 
     120        return map.keys; 
    113121    } 
    114122 
  • dwt/dwthelper/System.d

    r84 r197  
    129129        .exit(code); 
    130130    } 
     131    public static int identityHashCode(Object x){ 
     132        if( x is null ){ 
     133            return 0; 
     134        } 
     135        return (*cast(Object *)&x).toHash(); 
     136    } 
    131137 
     138    public static char[] getProperty( char[] key ){ 
     139        switch( key ){ 
     140        case "os.name": return "windows"; 
     141        default: return null; 
     142        } 
     143    } 
    132144} 
    133145 
  • dwt/dwthelper/utils.d

    r194 r197  
    1010 
    1111import tango.io.Stdout; 
     12import tango.io.Print; 
    1213import tango.stdc.stringz; 
    1314static import tango.text.Util; 
     15static import tango.text.Text; 
    1416import tango.text.Unicode; 
    1517import tango.text.convert.Utf; 
     
    1820 
    1921import tango.util.log.Trace; 
     22import tango.text.UnicodeData; 
     23static import tango.util.collection.model.Seq; 
     24// static import tango.util.collection.ArraySeq; 
     25// static import tango.util.collection.LinkSeq; 
     26// static import tango.util.collection.model.Map; 
     27// static import tango.util.collection.HashMap; 
     28// 
     29// alias tango.util.collection.model.Seq.Seq!(Object) List; 
     30// alias tango.util.collection.ArraySeq.ArraySeq!(Object) ArrayList; 
     31// alias tango.util.collection.LinkSeq.LinkSeq!(Object) LinkList; 
     32// alias tango.util.collection.model.Map.Map!(Object,Object) Map; 
     33// alias tango.util.collection.HashMap.HashMap!(Object,Object) HashMap; 
     34 
     35alias char[] String; 
     36alias tango.text.Text.Text!(char) StringBuffer; 
    2037 
    2138void implMissing( char[] file, uint line ){ 
     
    4259        value = data; 
    4360    } 
    44 
    45  
    46 alias ValueWrapperT!(bool)    ValueWrapperBool; 
    47 alias ValueWrapperT!(int)     ValueWrapperInt; 
    48 alias ValueWrapperT!(long)    ValueWrapperLong; 
     61    public int opEquals( T other ){ 
     62        return value == other; 
     63    } 
     64    public int opEquals( Object other ){ 
     65        if( auto o = cast(ValueWrapperT!(T))other ){ 
     66            return value == o.value; 
     67        } 
     68        return false; 
     69    } 
     70
     71 
     72class Boolean : ValueWrapperT!(bool) { 
     73    public static Boolean TRUE; 
     74    public static Boolean FALSE; 
     75    public this( bool v ){ 
     76        super(v); 
     77    } 
     78 
     79    alias ValueWrapperT!(bool).opEquals opEquals; 
     80    public int opEquals( int other ){ 
     81        return value == ( other !is 0 ); 
     82    } 
     83    public int opEquals( Object other ){ 
     84        if( auto o = cast(Boolean)other ){ 
     85            return value == o.value; 
     86        } 
     87        return false; 
     88    } 
     89    public bool booleanValue(){ 
     90        return value; 
     91    } 
     92
     93 
     94alias Boolean    ValueWrapperBool; 
     95 
     96 
     97class Byte : ValueWrapperT!(byte) { 
     98    public static byte parseByte( char[] s ){ 
     99        try{ 
     100            int res = tango.text.convert.Integer.parse( s ); 
     101            if( res < byte.min || res > byte.max ){ 
     102                throw new NumberFormatException( "out of range" ); 
     103            } 
     104            return res; 
     105        } 
     106        catch( IllegalArgumentException e ){ 
     107            throw new NumberFormatException( e ); 
     108        } 
     109    } 
     110    this( byte value ){ 
     111        super( value ); 
     112    } 
     113
     114alias Byte ValueWrapperByte; 
     115 
     116 
     117class Integer : ValueWrapperT!(int) { 
     118 
     119    public static int MIN_VALUE = 0x80000000; 
     120    public static int MAX_VALUE = 0x7fffffff; 
     121    public static int SIZE = 32; 
     122 
     123    public this ( int value ){ 
     124        super( value ); 
     125    } 
     126 
     127    public this ( char[] s ){ 
     128            implMissing( __FILE__, __LINE__ ); 
     129            super(0); 
     130    } 
     131 
     132    public static char[] toString( int i, int radix ){ 
     133        switch( radix ){ 
     134        case 2: 
     135            return toBinaryString(i); 
     136        case 8: 
     137            return toOctalString(i); 
     138        case 10: 
     139            return toString(i); 
     140        case 16: 
     141            return toHexString(i); 
     142        default: 
     143            implMissing( __FILE__, __LINE__ ); 
     144            return null; 
     145        } 
     146    } 
     147 
     148    public static char[] toHexString( int i ){ 
     149        return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex ); 
     150    } 
     151 
     152    public static char[] toOctalString( int i ){ 
     153        return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal ); 
     154    } 
     155 
     156    public static char[] toBinaryString( int i ){ 
     157        return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary ); 
     158    } 
     159 
     160    public static char[] toString( int i ){ 
     161        return tango.text.convert.Integer.toString(i); 
     162    } 
     163 
     164    public static int parseInt( char[] s, int radix ){ 
     165        try{ 
     166            return tango.text.convert.Integer.parse( s, cast(uint)radix ); 
     167        } 
     168        catch( IllegalArgumentException e ){ 
     169            throw new NumberFormatException( e ); 
     170        } 
     171    } 
     172 
     173    public static int parseInt( char[] s ){ 
     174        try{ 
     175            return tango.text.convert.Integer.parse( s ); 
     176        } 
     177        catch( IllegalArgumentException e ){ 
     178            throw new NumberFormatException( e ); 
     179        } 
     180    } 
     181 
     182    public static Integer valueOf( char[] s, int radix ){ 
     183        implMissing( __FILE__, __LINE__ ); 
     184        return null; 
     185    } 
     186 
     187    public static Integer valueOf( char[] s ){ 
     188        implMissing( __FILE__, __LINE__ ); 
     189        return null; 
     190    } 
     191 
     192    public static Integer valueOf( int i ){ 
     193        implMissing( __FILE__, __LINE__ ); 
     194        return null; 
     195    } 
     196 
     197    public byte byteValue(){ 
     198        return cast(byte)value; 
     199    } 
     200 
     201    public short shortValue(){ 
     202        return cast(short)value; 
     203    } 
     204 
     205    public int intValue(){ 
     206        return value; 
     207    } 
     208 
     209    public long longValue(){ 
     210        return cast(long)value; 
     211    } 
     212 
     213    public float floatValue(){ 
     214        return cast(float)value; 
     215    } 
     216 
     217    public double doubleValue(){ 
     218        return cast(double)value; 
     219    } 
     220 
     221    public override  hash_t toHash(){ 
     222        return intValue(); 
     223    } 
     224 
     225    public override char[] toString(){ 
     226        return tango.text.convert.Integer.toString( value ); 
     227    } 
     228
     229alias Integer ValueWrapperInt; 
     230 
     231class Double : ValueWrapperT!(double) { 
     232    this( double value ){ 
     233        super(value); 
     234    } 
     235    this( char[] str ){ 
     236        implMissing( __FILE__, __LINE__ ); 
     237        super(0.0); 
     238    } 
     239    public double doubleValue(){ 
     240        return value; 
     241    } 
     242    public static char[] toString( double value ){ 
     243        implMissing( __FILE__, __LINE__ ); 
     244        return null; 
     245    } 
     246
     247 
     248class Float : ValueWrapperT!(float) { 
     249 
     250    public static float POSITIVE_INFINITY = (1.0f / 0.0f); 
     251    public static float NEGATIVE_INFINITY = ((-1.0f) / 0.0f); 
     252    public static float NaN = (0.0f / 0.0f); 
     253    public static float MAX_VALUE = 3.4028235e+38f; 
     254    public static float MIN_VALUE = 1.4e-45f; 
     255    public static int SIZE = 32; 
     256 
     257    this( float value ){ 
     258        super(value); 
     259    } 
     260    this( char[] str ){ 
     261        implMissing( __FILE__, __LINE__ ); 
     262        super(0.0); 
     263    } 
     264    public float floatValue(){ 
     265        return value; 
     266    } 
     267    public static char[] toString( float value ){ 
     268        implMissing( __FILE__, __LINE__ ); 
     269        return null; 
     270    } 
     271    public static float parseFloat( char[] s ){ 
     272        try{ 
     273            return tango.text.convert.Float.toFloat( s ); 
     274        } 
     275        catch( IllegalArgumentException e ){ 
     276            throw new NumberFormatException( e ); 
     277        } 
     278    } 
     279 
     280
     281class Long : ValueWrapperT!(long) { 
     282    this( long value ){ 
     283        super(value); 
     284    } 
     285    this( char[] str ){ 
     286        implMissing( __FILE__, __LINE__ ); 
     287        super(0); 
     288    } 
     289    public long longValue(){ 
     290        return value; 
     291    } 
     292    public static long parseLong(char[] s){ 
     293        implMissing( __FILE__, __LINE__ ); 
     294        return 0; 
     295    } 
     296    public static char[] toString( double value ){ 
     297        implMissing( __FILE__, __LINE__ ); 
     298        return null; 
     299    } 
     300
     301alias Long ValueWrapperLong; 
     302 
     303 
     304// alias ValueWrapperT!(int)     ValueWrapperInt; 
     305 
    49306alias ArrayWrapperT!(byte)    ArrayWrapperByte; 
    50307alias ArrayWrapperT!(int)     ArrayWrapperInt; 
     
    53310alias ArrayWrapperT!(char[])  ArrayWrapperString2; 
    54311 
     312Object[] StringArrayToObjectArray( String[] strs ){ 
     313    Object[] res = new Object[strs.length]; 
     314    foreach( idx, str; strs ){ 
     315        res[idx] = new ArrayWrapperString(str); 
     316    } 
     317    return res; 
     318} 
    55319int codepointIndexToIndex( char[] str, int cpIndex ){ 
    56320    int cps = cpIndex; 
     
    204468} 
    205469 
     470bool CharacterIsDefined( dchar ch ){ 
     471    return (ch in tango.text.UnicodeData.unicodeData) !is null; 
     472} 
    206473dchar CharacterFirstToLower( char[] str ){ 
    207474    int consumed; 
     
    229496    return tango.text.Unicode.isDigit( c ); 
    230497} 
     498bool CharacterIsLetter( dchar c ){ 
     499    return tango.text.Unicode.isLetter( c ); 
     500} 
     501public char[] toUpperCase( char[] str ){ 
     502    return tango.text.Unicode.toUpper( str ); 
     503} 
    231504 
    232505public int indexOf( char[] str, char searched ){ 
     
    260533    return res; 
    261534} 
     535public int lastIndexOf(char[] str, char[] ch ){ 
     536    return lastIndexOf( str, ch, str.length ); 
     537} 
     538public int lastIndexOf(char[] str, char[] ch, int start ){ 
     539    int res = tango.text.Util.locatePatternPrior( str, ch, start ); 
     540    if( res is str.length ) res = -1; 
     541    return res; 
     542} 
    262543 
    263544public char[] replace( char[] str, char from, char to ){ 
     
    314595    return src[ 0 .. pattern.length ] == pattern; 
    315596} 
     597 
    316598public char[] toLowerCase( char[] src ){ 
    317599    return tango.text.Unicode.toLower( src ); 
     
    324606public char[] trim( char[] str ){ 
    325607    return tango.text.Util.trim( str ).dup; 
     608} 
     609public char[] intern( char[] str ){ 
     610    return str; 
    326611} 
    327612 
     
    347632} 
    348633 
     634class RuntimeException : Exception { 
     635    this( char[] e = null){ 
     636        super(e); 
     637    } 
     638    this( Exception e ){ 
     639        super(e.toString); 
     640    } 
     641} 
     642class IndexOutOfBoundsException : Exception { 
     643    this( char[] e = null){ 
     644        super(e); 
     645    } 
     646} 
     647 
     648class UnsupportedOperationException : RuntimeException { 
     649    this( char[] e = null){ 
     650        super(e); 
     651    } 
     652    this( Exception e ){ 
     653        super(e.toString); 
     654    } 
     655} 
    349656class NumberFormatException : IllegalArgumentException { 
    350657    this( char[] e ){ 
     
    353660    this( Exception e ){ 
    354661        super(e.toString); 
     662    } 
     663} 
     664class NullPointerException : Exception { 
     665    this( char[] e = null ){ 
     666        super(e); 
     667    } 
     668    this( Exception e ){ 
     669        super(e.toString); 
     670    } 
     671} 
     672class IllegalStateException : Exception { 
     673    this( char[] e = null ){ 
     674        super(e); 
     675    } 
     676    this( Exception e ){ 
     677        super(e.toString); 
     678    } 
     679} 
     680class InterruptedException : Exception { 
     681    this( char[] e = null ){ 
     682        super(e); 
     683    } 
     684    this( Exception e ){ 
     685        super(e.toString); 
     686    } 
     687} 
     688class InvocationTargetException : Exception { 
     689    Exception cause; 
     690    this( Exception e = null, char[] msg = null ){ 
     691        super(msg); 
     692        cause = e; 
     693    } 
     694 
     695    alias getCause getTargetException; 
     696    Exception getCause(){ 
     697        return cause; 
     698    } 
     699} 
     700class MissingResourceException : Exception { 
     701    char[] classname; 
     702    char[] key; 
     703    this( char[] msg, char[] classname, char[] key ){ 
     704        super(msg); 
     705        this.classname = classname; 
     706        this.key = key; 
     707    } 
     708} 
     709class ParseException : Exception { 
     710    this( char[] e = null ){ 
     711        super(e); 
     712    } 
     713} 
     714 
     715interface Cloneable{ 
     716} 
     717 
     718interface Comparable { 
     719    int compareTo(Object o); 
     720} 
     721interface Comparator { 
     722    int compare(Object o1, Object o2); 
     723} 
     724interface EventListener{ 
     725} 
     726 
     727class EventObject { 
     728    protected Object source; 
     729 
     730    public this(Object source) { 
     731        if (source is null) 
     732        throw new IllegalArgumentException( "null arg" ); 
     733        this.source = source; 
     734    } 
     735 
     736    public Object getSource() { 
     737        return source; 
     738    } 
     739 
     740    public override char[] toString() { 
     741        return this.classinfo.name ~ "[source=" ~ source.toString() ~ "]"; 
    355742    } 
    356743} 
     
    371758 
    372759 
    373  
    374  
     760void ExceptionPrintStackTrace( Exception e ){ 
     761    ExceptionPrintStackTrace( e, Stderr ); 
     762
     763void ExceptionPrintStackTrace( Exception e, Print!(char) print ){ 
     764    print.formatln( "Exception in {}({}): {}", e.file, e.line, e.msg ); 
     765
     766 
     767interface Reader{ 
     768
     769interface Writer{ 
     770
     771 
     772 
     773class Collator : Comparator { 
     774    public static Collator getInstance(){ 
     775        implMissing( __FILE__, __LINE__ ); 
     776        return null; 
     777    } 
     778    private this(){ 
     779    } 
     780    int compare(Object o1, Object o2){ 
     781        implMissing( __FILE__, __LINE__ ); 
     782        return 0; 
     783    } 
     784
     785 
     786interface Enumeration { 
     787    public bool hasMoreElements(); 
     788    public Object nextElement(); 
     789
     790 
     791 
     792template arraycast(T) { 
     793    T[] arraycast(U) (U[] u) { 
     794        static if ( 
     795            (is (T == interface ) && is (U == interface )) || 
     796            (is (T == class ) && is (U == class ))) { 
     797            return(cast(T[])u); 
     798        } 
     799        else { 
     800            int l = u.length; 
     801            T[] res; 
     802            res.length = l; 
     803            for (int i = 0; i < l; i++) { 
     804                res[i] = cast(T)u[i]; 
     805            } 
     806            return(res); 
     807        } 
     808    } 
     809
     810 
     811char[] stringcast( Object o ){ 
     812    if( auto str = cast(ArrayWrapperString) o ){ 
     813        return str.array; 
     814    } 
     815    return null; 
     816
     817char[][] stringcast( Object[] objs ){ 
     818    char[][] res = new char[][](objs.length); 
     819    foreach( idx, obj; objs ){ 
     820        res[idx] = stringcast(obj); 
     821    } 
     822    return res; 
     823
     824ArrayWrapperString stringcast( char[] str ){ 
     825    return new ArrayWrapperString( str ); 
     826
     827ArrayWrapperString[] stringcast( char[][] strs ){ 
     828    ArrayWrapperString[] res = new ArrayWrapperString[ strs.length ]; 
     829    foreach( idx, str; strs ){ 
     830        res[idx] = stringcast(str); 
     831    } 
     832    return res; 
     833
     834 
     835 
     836bool ArrayEquals(T)( T[] a, T[] b ){ 
     837    if( a.length !is b.length ){ 
     838        return false; 
     839    } 
     840    for( int i = 0; i < a.length; i++ ){ 
     841        static if( is( T==class) || is(T==interface)){ 
     842            if( a[i] !is null && b[i] !is null ){ 
     843                if( a[i] != b[i] ){ 
     844                    return false; 
     845                } 
     846            } 
     847            else if( a[i] is null && b[i] is null ){ 
     848            } 
     849            else{ 
     850                return false; 
     851            } 
     852        } 
     853        else{ 
     854            if( a[i] != b[i] ){ 
     855                return false; 
     856            } 
     857        } 
     858    } 
     859
     860 
     861class Arrays{ 
     862    public static bool equals(Object[] a, Object[] b){ 
     863        if( a.length !is b.length ){ 
     864            return false; 
     865        } 
     866        for( int i = 0; i < a.length; i++ ){ 
     867            if( a[i] is null && b[i] is null ){ 
     868                continue; 
     869            } 
     870            if( a[i] !is null && b[i] !is null && a[i] == b[i] ){ 
     871                continue; 
     872            } 
     873            return false; 
     874        } 
     875        return true; 
     876    } 
     877
     878 
     879int SeqIndexOf(T)( tango.util.collection.model.Seq.Seq!(T) s, T src ){ 
     880    int idx; 
     881    foreach( e; s ){ 
     882        if( e == src ){ 
     883            return idx; 
     884        } 
     885        idx++; 
     886    } 
     887    return -1; 
     888
     889int arrayIndexOf(T)( T[] arr, T v ){ 
     890    int res = -1; 
     891    int idx = 0; 
     892    foreach( p; arr ){ 
     893        if( p == v){ 
     894            res = idx; 
     895            break; 
     896        } 
     897        idx++; 
     898    } 
     899    return res; 
     900
     901 
     902int seqIndexOf( tango.util.collection.model.Seq.Seq!(Object) seq, Object v ){ 
     903    int res = -1; 
     904    int idx = 0; 
     905    foreach( p; seq ){ 
     906        if( p == v){ 
     907            res = idx; 
     908            break; 
     909        } 
     910        idx++; 
     911    } 
     912    return res; 
     913
     914 
     915void PrintStackTrace(){ 
     916    try{ 
     917        throw new Exception( null ); 
     918    } 
     919    catch( Exception e ){ 
     920        foreach( msg; e.info ){ 
     921            Trace.formatln( "trc: {}", msg ); 
     922        } 
     923    } 
     924
     925 
     926struct ImportData{ 
     927    void[] data; 
     928    char[] name; 
     929 
     930    public static ImportData opCall( void[] data, char[] name ){ 
     931        ImportData res; 
     932        res.data = data; 
     933        res.name = name; 
     934        return res; 
     935    } 
     936
     937 
     938template getImportData(char[] name ){ 
     939    const ImportData getImportData = ImportData( import(name), name ); 
     940
  • dwt/graphics/Color.d

    r48 r197  
    1212 *******************************************************************************/ 
    1313module dwt.graphics.Color; 
    14  
    1514 
    1615import dwt.DWT; 
     
    8685    if (device is null) device = Device.getDevice(); 
    8786    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    88     init(device, red, green, blue); 
     87    init_(device, red, green, blue); 
    8988    if (device.tracking) device.new_Object(this); 
    9089} 
     
    116115    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    117116    if (rgb is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    118     init(device, rgb.red, rgb.green, rgb.blue); 
     117    init_(device, rgb.red, rgb.green, rgb.blue); 
    119118    if (device.tracking) device.new_Object(this); 
    120119} 
     
    250249 * @see #dispose 
    251250 */ 
    252 void init(Device device, int red, int green, int blue) { 
     251void init_(Device device, int red, int green, int blue) { 
    253252    if (red > 255 || red < 0 || green > 255 || green < 0 || blue > 255 || blue < 0) { 
    254253        DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
  • dwt/graphics/Cursor.d

    r175 r197  
    348348    } 
    349349    ImageData mask = source.getTransparencyMask(); 
    350     int[] result = Image.init(device, null, source, mask); 
     350    int[] result = Image.init_(device, null, source, mask); 
    351351    auto hBitmap = cast(HBITMAP)result[0]; 
    352352    auto hMask = cast(HBITMAP)result[1]; 
  • dwt/graphics/Device.d

    r174 r197  
    143143        } 
    144144        create (data); 
    145         init (); 
     145        init_ (); 
    146146        if (tracking) { 
    147147            errors = new Exception [128]; 
     
    656656 * @see #create 
    657657 */ 
    658 protected void init () { 
     658protected void init_ () { 
    659659    if (debug_) { 
    660660        static if (!OS.IsWinCE) OS.GdiSetBatchLimit(1); 
  • dwt/graphics/Font.d

    r48 r197  
    8181    if (device is null) device = Device.getDevice(); 
    8282    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    83     init(device, fd); 
     83    init_(device, fd); 
    8484    if (device.tracking) device.new_Object(this); 
    8585} 
     
    116116        if (fds[i] is null) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    117117    } 
    118     init(device, fds[0]); 
     118    init_(device, fds[0]); 
    119119    if (device.tracking) device.new_Object(this); 
    120120} 
     
    146146    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    147147    if (name is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    148     init(device, new FontData (name, height, style)); 
     148    init_(device, new FontData (name, height, style)); 
    149149    if (device.tracking) device.new_Object(this); 
    150150} 
     
    154154    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    155155    if (name is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    156     init(device, new FontData (name, height, style)); 
     156    init_(device, new FontData (name, height, style)); 
    157157    if (device.tracking) device.new_Object(this); 
    158158} 
     
    223223} 
    224224 
    225 void init (Device device, FontData fd) { 
     225void init_ (Device device, FontData fd) { 
    226226    if (fd is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    227227    this.device = device; 
  • dwt/graphics/FontData.d

    r175 r197  
    1818 
    1919import dwt.dwthelper.utils; 
    20 import dwt.dwthelper.Float; 
    21 import dwt.dwthelper.Integer; 
    2220static import tango.text.Text; 
    2321import tango.util.Convert; 
  • dwt/graphics/GC.d

    r194 r197  
    1212 *******************************************************************************/ 
    1313module dwt.graphics.GC; 
    14  
    15  
    16  
    17 /+ 
    18 //PORTING_TYPE 
    19 class GC{ 
    20     void dispose(); 
    21     bool isDisposed(); 
    22     void flush (); 
    23     GCData data; 
    24     HDC handle; 
    25 public void drawImage(Image image, int x, int y) ; 
    26 public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight) ; 
    27 void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, bool simple) ; 
    28 } 
    29 +/ 
    3014 
    3115import dwt.DWT; 
     
    197181    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    198182    this.device = data.device = device; 
    199     init (drawable, data, hDC); 
     183    init_ (drawable, data, hDC); 
    200184    if (device.tracking) device.new_Object(this); 
    201185} 
     
    37003684} 
    37013685 
    3702 void init(Drawable drawable, GCData data, HDC hDC) { 
     3686void init_(Drawable drawable, GCData data, HDC hDC) { 
    37033687    auto foreground = data.foreground; 
    37043688    if (foreground !is -1) { 
     
    48714855    auto hDC = drawable.internal_new_GC(data); 
    48724856    gc.device = data.device; 
    4873     gc.init(drawable, data, hDC); 
     4857    gc.init_(drawable, data, hDC); 
    48744858    return gc; 
    48754859} 
     
    48934877    GC gc = new GC(); 
    48944878    gc.device = data.device; 
    4895     gc.init(null, data, hDC); 
     4879    gc.init_(null, data, hDC); 
    48964880    return gc; 
    48974881} 
  • dwt/graphics/Image.d

    r117 r197  
    193193    if (device is null) device = Device.getDevice(); 
    194194    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    195     init(device, width, height); 
     195    init_(device, width, height); 
    196196    if (device.tracking) device.new_Object(this); 
    197197} 
     
    270270                case DWT.ICON: 
    271271                    static if (OS.IsWinCE) { 
    272                         init(device, srcImage.data); 
     272                        init_(device, srcImage.data); 
    273273                    } else { 
    274274                        handle = OS.CopyImage(srcImage.handle, OS.IMAGE_ICON, rect.width, rect.height, 0); 
     
    338338                } 
    339339            } 
    340             init (device, newData); 
     340            init_ (device, newData); 
    341341            if (device.tracking) device.new_Object(this); 
    342342            return; 
     
    403403                } 
    404404            } 
    405             init (device, newData); 
     405            init_ (device, newData); 
    406406            if (device.tracking) device.new_Object(this); 
    407407            return; 
     
    446446    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    447447    if (bounds is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    448     init(device, bounds.width, bounds.height); 
     448    init_(device, bounds.width, bounds.height); 
    449449    if (device.tracking) device.new_Object(this); 
    450450} 
     
    471471    if (device is null) device = Device.getDevice(); 
    472472    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    473     init(device, data); 
     473    init_(device, data); 
    474474    if (device.tracking) device.new_Object(this); 
    475475} 
     
    509509    } 
    510510    mask = ImageData.convertMask(mask); 
    511     init(device, this, source, mask); 
     511    init_(device, this, source, mask); 
    512512    if (device.tracking) device.new_Object(this); 
    513513} 
     
    564564    if (device is null) device = Device.getDevice(); 
    565565    if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    566     init(device, new ImageData(stream)); 
     566    init_(device, new ImageData(stream)); 
    567567    if (device.tracking) device.new_Object(this); 
    568568} 
     
    742742                  &nbs