# HG changeset patch # User kntroh # Date 1300280033 -32400 # Node ID 9f4c18c268b2a048a68d63070d0513045d9418f2 # Parent b6e9904989ede48a5affedb072dc8d607aefb3a1 Update to compile and execute with dmd 2.052. diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/beans/PropertyChangeSupport.d --- a/base/src/java/beans/PropertyChangeSupport.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/beans/PropertyChangeSupport.d Wed Mar 16 21:53:53 2011 +0900 @@ -24,7 +24,10 @@ list = *l; } list ~= listener; - listeners[ propertyName.dup ] = list; + version(Tango){ + propertyName = propertyName.dup; + } + listeners[ propertyName ] = list; } void firePropertyChange(String propertyName, bool oldValue, bool newValue){ firePropertyChange( propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue) ); @@ -55,7 +58,10 @@ implMissing( __FILE__, __LINE__ ); } if( list.length > 0 ){ - listeners[ propertyName.dup ] = *list; + version(Tango){ + propertyName = propertyName.dup; + } + listeners[ propertyName ] = *list; } else{ listeners.remove( propertyName ); diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/io/BufferedInputStream.d --- a/base/src/java/io/BufferedInputStream.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/io/BufferedInputStream.d Wed Mar 16 21:53:53 2011 +0900 @@ -54,30 +54,34 @@ istr = null; } } - public synchronized int read(){ - if( pos >= count ){ - fill(); + public int read(){ + synchronized { if( pos >= count ){ - return -1; + fill(); + if( pos >= count ){ + return -1; + } } + return getAndCheckBuf()[pos++] & 0xFF; } - return getAndCheckBuf()[pos++] & 0xFF; } - public synchronized int read( byte[] b, int off, int len ){ - return super.read( b, off, len ); + public int read( byte[] b, int off, int len ){ + synchronized return super.read( b, off, len ); + } + + public long skip( long n ){ + synchronized return this.istr.skip(n); } - public synchronized long skip( long n ){ - return this.istr.skip(n); - } - - public synchronized int available(){ - int istr_avail = 0; - if( istr !is null ){ - istr_avail = istr.available(); + public int available(){ + synchronized { + int istr_avail = 0; + if( istr !is null ){ + istr_avail = istr.available(); + } + return istr_avail + (count - pos); } - return istr_avail + (count - pos); } public synchronized void mark( int readlimit ){ diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/io/ByteArrayInputStream.d --- a/base/src/java/io/ByteArrayInputStream.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/io/ByteArrayInputStream.d Wed Mar 16 21:53:53 2011 +0900 @@ -25,36 +25,42 @@ this.buf = aBuf[ offset .. offset+length_ESCAPE ]; } - public synchronized int read(){ - if( pos >= this.buf.length ){ - return -1; + public int read(){ + synchronized { + if( pos >= this.buf.length ){ + return -1; + } + int result = this.buf[pos]; + pos++; + return result & 0xFF; } - int result = this.buf[pos]; - pos++; - return result & 0xFF; + } + + public int read( byte[] b, int off, int len ){ + synchronized return super.read( b, off, len ); } - public synchronized int read( byte[] b, int off, int len ){ - return super.read( b, off, len ); + public long skip( long n ){ + synchronized { + pos += n; + return 0L; + } } - public synchronized long skip( long n ){ - pos += n; - return 0L; - } - - public synchronized int available(){ - if( pos >= this.buf.length ){ - return 0; + public int available(){ + synchronized { + if( pos >= this.buf.length ){ + return 0; + } + return this.buf.length - pos; } - return this.buf.length - pos; } public bool markSupported(){ return false; } - public void mark( int readAheadLimit ){ + public synchronized void mark( int readAheadLimit ){ } public synchronized void reset(){ diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/io/ByteArrayOutputStream.d --- a/base/src/java/io/ByteArrayOutputStream.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/io/ByteArrayOutputStream.d Wed Mar 16 21:53:53 2011 +0900 @@ -34,46 +34,56 @@ } } - public synchronized override void write( int b ){ - version(Tango){ - byte[1] a; - a[0] = b & 0xFF; - buffer.append(a); - } else { // Phobos - implMissing( __FILE__, __LINE__ ); + public override void write( int b ){ + synchronized { + version(Tango){ + byte[1] a; + a[0] = b & 0xFF; + buffer.append(a); + } else { // Phobos + implMissing( __FILE__, __LINE__ ); + } } } - public synchronized override void write( byte[] b, int off, int len ){ - version(Tango){ - buffer.append( b[ off .. off + len ]); - } else { // Phobos - implMissing( __FILE__, __LINE__ ); + public override void write( byte[] b, int off, int len ){ + synchronized { + version(Tango){ + buffer.append( b[ off .. off + len ]); + } else { // Phobos + implMissing( __FILE__, __LINE__ ); + } } } - public synchronized override void write( byte[] b ){ - version(Tango){ - buffer.append( b ); - } else { // Phobos - implMissing( __FILE__, __LINE__ ); + public override void write( byte[] b ){ + synchronized { + version(Tango){ + buffer.append( b ); + } else { // Phobos + implMissing( __FILE__, __LINE__ ); + } } } - public synchronized void writeTo( java.io.OutputStream.OutputStream out_KEYWORDESCAPE ){ + public void writeTo( java.io.OutputStream.OutputStream out_KEYWORDESCAPE ){ + synchronized implMissing( __FILE__, __LINE__ ); } - public synchronized void reset(){ + public void reset(){ + synchronized implMissing( __FILE__, __LINE__ ); } - public synchronized byte[] toByteArray(){ - version(Tango){ - return cast(byte[])buffer.slice(); - } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return null; + public byte[] toByteArray(){ + synchronized { + version(Tango){ + return cast(byte[])buffer.slice(); + } else { // Phobos + implMissing( __FILE__, __LINE__ ); + return null; + } } } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/io/FileInputStream.d --- a/base/src/java/io/FileInputStream.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/io/FileInputStream.d Wed Mar 16 21:53:53 2011 +0900 @@ -10,6 +10,7 @@ version(Tango){ import TangoFile = tango.io.device.File; } else { // Phobos + static import std.stream; } public class FileInputStream : java.io.InputStream.InputStream { @@ -19,6 +20,7 @@ version(Tango){ private TangoFile.File conduit; } else { // Phobos + private std.stream.File conduit; } private ubyte[] buffer; private int buf_pos; @@ -30,7 +32,7 @@ version(Tango){ conduit = new TangoFile.File( name ); } else { // Phobos - implMissing( __FILE__, __LINE__ ); + conduit = new std.stream.File( name ); } buffer = new ubyte[]( BUFFER_SIZE ); } @@ -40,7 +42,7 @@ version(Tango){ conduit = new TangoFile.File( file.getAbsolutePath(), TangoFile.File.ReadExisting ); } else { // Phobos - implMissing( __FILE__, __LINE__ ); + conduit = new std.stream.File( file.getAbsolutePath(), std.stream.FileMode.In ); } buffer = new ubyte[]( BUFFER_SIZE ); } @@ -70,8 +72,28 @@ return -1; } } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return 0; + if( eof ){ + return -1; + } + try{ + if( buf_pos == buf_size ){ + buf_pos = 0; + buf_size = conduit.read( buffer ); + } + if( buf_size <= 0 ){ + eof = true; + return -1; + } + assert( buf_pos < BUFFER_SIZE, Format( "{} {}", buf_pos, buf_size ) ); + assert( buf_size <= BUFFER_SIZE ); + int res = cast(int) buffer[ buf_pos ]; + buf_pos++; + return res; + } + catch( IOException e ){ + eof = true; + return -1; + } } } @@ -89,7 +111,7 @@ version(Tango){ conduit.close(); } else { // Phobos - implMissing( __FILE__, __LINE__ ); + conduit.close(); } } } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/lang/Character.d --- a/base/src/java/lang/Character.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/lang/Character.d Wed Mar 16 21:53:53 2011 +0900 @@ -155,7 +155,7 @@ bool CharacterIsDefined( dchar ch ){ version(Tango){ - return tango.text.UnicodeData.getUnicodeData(ch) !is null; + return (ch in tango.text.UnicodeData.unicodeData) !is null; } else { // Phobos implMissing( __FILE__, __LINE__); return false; diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/lang/Integer.d --- a/base/src/java/lang/Integer.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/lang/Integer.d Wed Mar 16 21:53:53 2011 +0900 @@ -4,9 +4,12 @@ import java.lang.exceptions; import java.lang.Number; import java.lang.Class; +import java.lang.String; version(Tango){ } else { // Phobos + static import std.conv; + static import std.string; } version(Tango){ @@ -55,7 +58,7 @@ version(Tango){ return tango.text.convert.Integer.toString(i, "x" ); } else { // Phobos - return std.string.toString( cast(long)i, 16u ); + return std.string.format("%x", i); } } @@ -63,7 +66,7 @@ version(Tango){ return tango.text.convert.Integer.toString(i, "o" ); } else { // Phobos - return std.string.toString( cast(long)i, 8u ); + return std.string.format("%o", i); } } @@ -71,7 +74,7 @@ version(Tango){ return tango.text.convert.Integer.toString(i, "b" ); } else { // Phobos - return std.string.toString( cast(long)i, 2u ); + return std.string.format("%b", i); } } @@ -79,7 +82,7 @@ version(Tango){ return tango.text.convert.Integer.toString(i); } else { // Phobos - return std.string.toString( i ); + return std.conv.to!(string)( i ); } } @@ -145,7 +148,7 @@ version(Tango){ return tango.text.convert.Integer.toString( value ); } else { // Phobos - return std.string.toString(value); + return std.conv.to!(string)(value); } } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/lang/Math.d --- a/base/src/java/lang/Math.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/lang/Math.d Wed Mar 16 21:53:53 2011 +0900 @@ -28,7 +28,7 @@ static int min(uint a, int b){ return a < b ? a : b; } static int min(int a, uint b){ return a < b ? a : b; } static int min(uint a, uint b){ return a < b ? a : b; } - static int min(int a, long b){ return a < b ? a : b; } + static long min(int a, long b){ return a < b ? a : b; } static long min(long a, long b){ return a < b ? a : b; } static long min(long a, int b){ return a < b ? a : b; } @@ -42,7 +42,7 @@ static int max(uint a, int b){ return a > b ? a : b; } static int max(int a, uint b){ return a > b ? a : b; } static int max(uint a, uint b){ return a > b ? a : b; } - static int max(int a, long b){ return a > b ? a : b; } + static long max(int a, long b){ return a > b ? a : b; } static long max(long a, long b){ return a > b ? a : b; } static long max(long a, int b){ return a > b ? a : b; } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/lang/String.d --- a/base/src/java/lang/String.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/lang/String.d Wed Mar 16 21:53:53 2011 +0900 @@ -14,7 +14,10 @@ static import core.exception; static import std.uni; static import std.utf; + static import std.array; static import std.string; + static import std.conv; + static import std.exception; } version(Tango){ @@ -31,10 +34,10 @@ public alias wstring String16; mixin("public alias const(char)[] CString;"); mixin("public alias const(wchar)[] CString16;"); - mixin("public alias invariant(char)* ICharPtr;"); + mixin("public alias immutable(char)* ICharPtr;"); mixin("public alias const(char)* CCharPtr;"); mixin("public alias const(wchar)* CWCharPtr;"); - mixin("public alias invariant(wchar)* IWCharPtr;"); + mixin("public alias immutable(wchar)* IWCharPtr;"); } int codepointIndexToIndex( CString str, int cpIndex ){ @@ -402,8 +405,7 @@ version(Tango){ return tango.text.convert.Integer.toString(v); } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return null; + return std.conv.to!(String)(v); } } @@ -411,8 +413,7 @@ version(Tango){ return tango.text.convert.Integer.toString(v); } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return null; + return std.conv.to!(String)(v); } } @@ -420,8 +421,7 @@ version(Tango){ return tango.text.convert.Integer.toString(v); } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return null; + return std.conv.to!(String)(v); } } @@ -429,8 +429,7 @@ version(Tango){ return tango.text.convert.Float.toString(v); } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return null; + return std.conv.to!(String)(v); } } @@ -438,8 +437,7 @@ version(Tango){ return tango.text.convert.Float.toString(v); } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return null; + return std.conv.to!(String)(v); } } @@ -471,8 +469,7 @@ version(Tango){ return tango.text.convert.Utf.toString(wstr); } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return null; + return std.conv.to!(String)(wstr); } } @@ -503,8 +500,7 @@ if( res is str.length ) res = -1; return res; } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return 0; + return std.string.indexOf(str, searched); } } @@ -515,8 +511,9 @@ if( res is str.length ) res = -1; return res; } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return 0; + int res = std.string.indexOf(str[startpos .. $], searched); + if (res !is -1) res += startpos; + return res; } } @@ -582,8 +579,8 @@ version(Tango){ return tango.text.Util.replace( str.dup, from, to ); } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return null; + auto res = std.array.replace(str, [from], [to]); + return std.exception.assumeUnique(res); } } @@ -627,8 +624,7 @@ version(Tango){ return tango.text.convert.Utf.toString16(str); } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return null; + return std.conv.to!(String16)(str); } } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/lang/System.d --- a/base/src/java/lang/System.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/lang/System.d Wed Mar 16 21:53:53 2011 +0900 @@ -15,7 +15,7 @@ static import tango.stdc.stdlib; } else { // Phobos static import std.c.stdlib; - static import std.date; + static import std.datetime; static import std.path; } @@ -29,7 +29,7 @@ } } - static void remove(inout T[] items, int index) { + static void remove(ref T[] items, int index) { if(items.length == 0) return; @@ -53,7 +53,7 @@ items = items[0 .. index] ~ items[index + 1 .. $]; } - static void insert(inout T[] items, T item, int index = -1) { + static void insert(ref T[] items, T item, int index = -1) { if(index == -1) index = items.length; @@ -115,32 +115,28 @@ class System { - version(D_Version2){ - mixin("alias const(T) CT;"); - } else { // D1 - static void arraycopyT(T)(T[] src, uint srcPos, T[] dest, uint destPos, uint len) { - if(len == 0) return; + static void arraycopyT(T)(T[] src, uint srcPos, T[] dest, uint destPos, uint len) { + if(len == 0) return; - assert(src); - assert(dest); - debug{validCheck(src.length - srcPos, dest.length - destPos, len);} + assert(src); + assert(dest); + debug{validCheck(src.length - srcPos, dest.length - destPos, len);} - // overlapping? - if((src.ptr <= dest.ptr && src.ptr + len > dest.ptr) - ||(src.ptr >= dest.ptr && src.ptr < dest.ptr + len)){ - if( destPos < srcPos ){ - for(int i=0; i dest.ptr) + ||(src.ptr >= dest.ptr && src.ptr < dest.ptr + len)){ + if( destPos < srcPos ){ + for(int i=0; i=0; --i){ - dest[destPos+i] = cast(T)src[srcPos+i]; - } + } + else{ + for(int i=len-1; i>=0; --i){ + dest[destPos+i] = cast(T)src[srcPos+i]; } - }else{ - dest[destPos..(len+destPos)] = cast(T[])src[srcPos..(len+srcPos)]; } + }else{ + dest[destPos..(len+destPos)] = cast(T[])src[srcPos..(len+srcPos)]; } } @@ -177,7 +173,7 @@ static long currentTimeMillis(){ version(Tango) return tango.time.Clock.Clock.now().ticks() / 10000; - else return std.date.getUTCtime() / (std.date.TicksPerSecond/1000); + else return std.datetime.Clock.currStdTime(); } static void exit( int code ){ diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/lang/Thread.d --- a/base/src/java/lang/Thread.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/lang/Thread.d Wed Mar 16 21:53:53 2011 +0900 @@ -56,11 +56,11 @@ public this(Runnable runnable, String name){ thread = new TThread(&internalRun); this.runnable = runnable; - thread.name = cast(char[])name; + thread.name = name; } public this(String name){ thread = new TThread(&internalRun); - thread.name = cast(char[])name; + thread.name = name; } public void start(){ @@ -133,7 +133,7 @@ } public void setName(String name){ - thread.name = cast(char[])name; + thread.name = name; } public String getName(){ return cast(String)thread.name; diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/lang/ThreadLocal.d --- a/base/src/java/lang/ThreadLocal.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/lang/ThreadLocal.d Wed Mar 16 21:53:53 2011 +0900 @@ -1,22 +1,39 @@ module java.lang.ThreadLocal; import java.lang.util; -static import tango.core.Thread; +version(Tango){ + static import tango.core.Thread; -class ThreadLocal{ - alias tango.core.Thread.ThreadLocal!(Object) TLSType; - TLSType tls; - this(){ - tls = new TLSType( initialValue() ); + class ThreadLocal{ + alias tango.core.Thread.ThreadLocal!(Object) TLSType; + TLSType tls; + this(){ + tls = new TLSType( initialValue() ); + } + Object get(){ + return tls.val(); + } + protected Object initialValue(){ + return null; + } + void set(Object value){ + return tls.val( value ); + } } - Object get(){ - return tls.val(); - } - protected Object initialValue(){ - return null; - } - void set(Object value){ - return tls.val( value ); +} else { // Phobos + class ThreadLocal{ + Object tls; + this(){ + tls = initialValue(); + } + Object get(){ + return tls; + } + protected Object initialValue(){ + return null; + } + void set(Object value){ + return tls = value; + } } } - diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/lang/exceptions.d --- a/base/src/java/lang/exceptions.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/lang/exceptions.d Wed Mar 16 21:53:53 2011 +0900 @@ -132,7 +132,7 @@ class RuntimeException : Exception { this( String file, long line, String msg = null){ - super( msg, file, line ); + super( msg, file, cast(size_t) line ); } this( String e = null){ super(e); @@ -170,26 +170,51 @@ /// Extension to the D Exception void ExceptionPrintStackTrace( Throwable e, void delegate ( String file, ulong line, String fmt, ... ) dg ){ - Throwable exception = e; - while( exception !is null ){ - dg( exception.file, exception.line, "Exception in {}({}): {}", exception.file, exception.line, exception.msg ); - if( exception.info !is null ){ - foreach( frame; exception.info ){ - dg( exception.file, exception.line, "trc {} {}", frame.file, frame.line ); + version(Tango){ + Throwable exception = e; + while( exception !is null ){ + dg( exception.file, exception.line, "Exception in {}({}): {}", exception.file, exception.line, exception.msg ); + if( exception.info !is null ){ + foreach( frame; exception.info ){ + dg( exception.file, exception.line, "trc {} {}", frame.file, frame.line ); + } } + exception = exception.next; } - exception = exception.next; + } else { // Phobos + Throwable exception = e; + while( exception !is null ){ + dg( exception.file, exception.line, "Exception in {}({}): {}", exception.file, exception.line, exception.msg ); + if( exception.info !is null ){ + foreach( line, file; exception.info ){ + dg( exception.file, exception.line, "trc {} {}", file, line ); + } + } + exception = exception.next; + } } } void PrintStackTrace( int deepth = 100, String prefix = "trc" ){ - auto e = new Exception( null ); - int idx = 0; - const start = 3; - foreach( frame; e.info ){ - if( idx >= start && idx < start+deepth ) { - getDwtLogger().trace( __FILE__, __LINE__, "{} {}: {}", prefix, frame.file, frame.line ); + version(Tango){ + auto e = new Exception( null ); + int idx = 0; + const start = 3; + foreach( frame; e.info ){ + if( idx >= start && idx < start+deepth ) { + getDwtLogger().trace( __FILE__, __LINE__, "{} {}: {}", prefix, frame.file, frame.line ); + } + idx++; } - idx++; + } else { // Phobos + auto e = new Exception( null ); + int idx = 0; + const start = 3; + foreach( line, file; e.info ){ + if( idx >= start && idx < start+deepth ) { + getDwtLogger().trace( __FILE__, __LINE__, "{} {}: {}", prefix, file, line ); + } + idx++; + } } } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/lang/util.d --- a/base/src/java/lang/util.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/lang/util.d Wed Mar 16 21:53:53 2011 +0900 @@ -16,6 +16,9 @@ static import core.exception; static import std.c.stdlib; static import std.stdio; + static import std.array; + static import std.format; + static import std.exception; alias std.c.stdlib.exit exit; } @@ -121,14 +124,25 @@ } else { // Phobos class Format{ static String opCall( String fmt, ... ){ - implMissing(__FILE__,__LINE__); - return null; + fmt = std.array.replace(fmt, "%", "%%"); + fmt = std.array.replace(fmt, "{}", "%s"); + char[] buf; + void putc(dchar c) { + if (c <= 0x7F) { + buf ~= cast(char)c; + } else { + char[4] buf2; + buf ~= std.utf.toUTF8(buf2, c); + } + } + std.format.doFormat(&putc, _arguments, _argptr); + return std.exception.assumeUnique(buf); } } } version( D_Version2 ){ - mixin("invariant(T)[] _idup(T)( T[] str ){ return str.idup; }"); + mixin("immutable(T)[] _idup(T)( T[] str ){ return str.idup; }"); } else { // D1 String16 _idup( String16 str ){ return str.dup; diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/math/BigDecimal.d --- a/base/src/java/math/BigDecimal.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/math/BigDecimal.d Wed Mar 16 21:53:53 2011 +0900 @@ -45,7 +45,7 @@ * and bogus scale calculation. */ if (significand == 0) { - intVal = BigInteger.ZERO; + intVal = cast(BigInteger) BigInteger.ZERO; intCompact = 0; precision = 1; return; @@ -66,7 +66,7 @@ intVal = intVal.multiply(BigInteger.valueOf(2).pow(exponent)); } if (intVal.bitLength() <= MAX_BIGINT_BITS) { - intCompact = intVal.longValue(); + intCompact = cast(int)intVal.longValue(); } } this(String val){ diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/math/BigInteger.d --- a/base/src/java/math/BigInteger.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/math/BigInteger.d Wed Mar 16 21:53:53 2011 +0900 @@ -5,6 +5,7 @@ version(Tango){ import tango.math.BigInt; } else { // Phobos + import std.bigint; } class BigInteger : Number { @@ -15,8 +16,8 @@ private BigInt bi; static this(){ - ZERO = BigInteger.valueOf(0); - ONE = BigInteger.valueOf(1); + ZERO = new BigInteger("0"); + ONE = new BigInteger("1"); } this(byte[] val){ @@ -47,11 +48,9 @@ } } private this( BigInt v ){ - getDwtLogger.error( __FILE__, __LINE__, "this({})", v.toHex ); bi = v; } private this( BigInteger v ){ - getDwtLogger.error( __FILE__, __LINE__, "this({})", bi.toHex ); bi = v.bi; } private this( long v ){ @@ -140,39 +139,43 @@ return 0; } long longValue(){ - getDwtLogger.error( __FILE__, __LINE__, "{}", bi.toHex ); - long res = 0; - auto txt = bi.toHex; - bool sign = false; - if( txt[0] is '-' ){ - sign = true; - txt = txt[1 .. $]; - } - int nibbles = 0; - foreach( uint idx, char c; txt ){ - if( c is '_' ) continue; - void addNibble( int v ){ - res <<= 4; - res |= v; - nibbles++; + version(Tango){ + getDwtLogger.error( __FILE__, __LINE__, "{}", bi.toHex ); + long res = 0; + auto txt = bi.toHex; + bool sign = false; + if( txt[0] is '-' ){ + sign = true; + txt = txt[1 .. $]; } - if( c >= '0' && c <= '9' ) { - addNibble( c - '0' ); - } - else if( c >= 'a' && c <= 'f' ) { - addNibble( c - 'a' + 10 ); - } - else if( c >= 'A' && c <= 'F' ) { - addNibble( c - 'A' + 10 ); + int nibbles = 0; + foreach( uint idx, char c; txt ){ + if( c is '_' ) continue; + void addNibble( int v ){ + res <<= 4; + res |= v; + nibbles++; + } + if( c >= '0' && c <= '9' ) { + addNibble( c - '0' ); + } + else if( c >= 'a' && c <= 'f' ) { + addNibble( c - 'a' + 10 ); + } + else if( c >= 'A' && c <= 'F' ) { + addNibble( c - 'A' + 10 ); + } + else{ + getDwtLogger.error( __FILE__, __LINE__, "unknown char {} @{}", c, idx ); + } } - else{ - getDwtLogger.error( __FILE__, __LINE__, "unknown char {} @{}", c, idx ); + if( nibbles > 16 ){ + getDwtLogger.error( __FILE__, __LINE__, "too much nibbles {}", nibbles ); } + return res; + } else { // Phobos + return bi.toLong(); } - if( nibbles > 16 ){ - getDwtLogger.error( __FILE__, __LINE__, "too much nibbles {}", nibbles ); - } - return res; } BigInteger max(BigInteger val){ implMissing(__FILE__, __LINE__ ); @@ -195,7 +198,6 @@ return null; } BigInteger multiply(BigInteger val){ - getDwtLogger.error( __FILE__, __LINE__, "multiply ({})", val.bi.toHex ); auto res = new BigInteger(this); res.bi *= val.bi; return res; @@ -216,8 +218,14 @@ if( exponent < 0 ){ throw new ArithmeticException("Negative exponent"); } - if( bi.isZero() ){ - return exponent is 0 ? ONE : this; + version(Tango){ + if( bi.isZero() ){ + return exponent is 0 ? ONE : this; + } + } else { // Phobos + if( bi == 0 ){ + return exponent is 0 ? cast(BigInteger)ONE : this; + } } auto a = bi; while(exponent>0){ @@ -247,8 +255,13 @@ return null; } int signum(){ - if( bi.isZero() ) return 0; - if( bi.isNegative() ) return -1; + version(Tango) { + if( bi.isZero() ) return 0; + if( bi.isNegative() ) return -1; + } else { // Phobos + if( bi == 0 ) return 0; + if( bi < 0 ) return -1; + } return 1; } BigInteger subtract(BigInteger val){ diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/nonstandard/RuntimeTraits.d --- a/base/src/java/nonstandard/RuntimeTraits.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/nonstandard/RuntimeTraits.d Wed Mar 16 21:53:53 2011 +0900 @@ -267,13 +267,24 @@ } /// -ModuleInfo moduleOf (ClassInfo type) -{ - foreach (modula; ModuleInfo) - foreach (klass; modula.localClasses) - if (klass is type) - return modula; - return null; +version(Tango){ + ModuleInfo moduleOf (ClassInfo type) + { + foreach (modula; ModuleInfo) + foreach (klass; modula.localClasses) + if (klass is type) + return modula; + return null; + } +} else { // Phobos + ModuleInfo* moduleOf (ClassInfo type) + { + foreach (modula; ModuleInfo) + foreach (klass; modula.localClasses) + if (klass is type) + return modula; + return null; + } } /// Returns a list of interfaces that this class directly implements. diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/nonstandard/SharedLib.d --- a/base/src/java/nonstandard/SharedLib.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/nonstandard/SharedLib.d Wed Mar 16 21:53:53 2011 +0900 @@ -4,6 +4,8 @@ version(Tango){ static import tango.sys.SharedLib; static import tango.stdc.stringz; +} else { // Phobos + import std.loader; } struct Symbol { @@ -22,7 +24,7 @@ static void loadLibSymbols( SymbolVersioned2[] symbols, String libname, int major, int minor ){ version(Tango){ if (auto lib = tango.sys.SharedLib.SharedLib.load(libname)) { - foreach( inout s; symbols ){ + foreach( ref s; symbols ){ if( s.major > major ) continue; if( s.major == major && s.minor > minor ) continue; *s.symbol = lib.getSymbol( tango.stdc.stringz.toStringz(s.name ) ); @@ -34,13 +36,24 @@ getDwtLogger.error( __FILE__, __LINE__, "Could not load the library {}", libname ); } } else { // Phobos - implMissing( __FILE__, __LINE__ ); + if (auto lib = ExeModule_Load(libname)) { + foreach( ref s; symbols ){ + if( s.major > major ) continue; + if( s.major == major && s.minor > minor ) continue; + *s.symbol = ExeModule_GetSymbol( lib, s.name ); + if( s.symbol is null ){ + getDwtLogger.error( __FILE__, __LINE__, "{}: Symbol '{}' not found", libname, s.name ); + } + } + } else { + getDwtLogger.error( __FILE__, __LINE__, "Could not load the library {}", libname ); + } } } static void loadLibSymbols( Symbol[] symbols, String libname ){ version(Tango){ if (auto lib = tango.sys.SharedLib.SharedLib.load(libname)) { - foreach( inout s; symbols ){ + foreach( ref s; symbols ){ *s.symbol = lib.getSymbol( tango.stdc.stringz.toStringz(s.name ) ); if( s.symbol is null ){ getDwtLogger.error( __FILE__, __LINE__, "{}: Symbol '{}' not found", libname, s.name ); @@ -50,7 +63,16 @@ getDwtLogger.error( __FILE__, __LINE__, "Could not load the library {}", libname ); } } else { // Phobos - implMissing( __FILE__, __LINE__ ); + if (auto lib = ExeModule_Load(libname)) { + foreach( ref s; symbols ){ + *s.symbol = ExeModule_GetSymbol( lib, s.name ); + if( s.symbol is null ){ + getDwtLogger.error( __FILE__, __LINE__, "{}: Symbol '{}' not found", libname, s.name ); + } + } + } else { + getDwtLogger.error( __FILE__, __LINE__, "Could not load the library {}", libname ); + } } } static bool tryUseSymbol( String symbolname, String libname, void delegate( void*) dg ){ @@ -65,7 +87,14 @@ lib.unload(); } } else { // Phobos - implMissing( __FILE__, __LINE__ ); + if (auto lib = ExeModule_Load( libname ) ) { + void* ptr = ExeModule_GetSymbol( lib, symbolname ); + if (ptr !is null){ + dg(ptr); + result = true; + } + ExeModule_Release( lib ); + } } return result; } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/nonstandard/XmlTranscode.d --- a/base/src/java/nonstandard/XmlTranscode.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/nonstandard/XmlTranscode.d Wed Mar 16 21:53:53 2011 +0900 @@ -138,8 +138,8 @@ case '\r': case '\n': case '\u0009': default: char toHexDigit( int i ){ - if( i < 10 ) return '0'+i; - return 'A'+i-10; + if( i < 10 ) return cast(char)('0'+i); + return cast(char)('A'+i-10); } res ~= "#x"; if( c <= 0xFF ){ @@ -175,5 +175,6 @@ res ~= ';'; } } + assert (0); } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/text/MessageFormat.d --- a/base/src/java/text/MessageFormat.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/text/MessageFormat.d Wed Mar 16 21:53:53 2011 +0900 @@ -14,6 +14,7 @@ case 5: return java.lang.util.Format(frmt, args[0], args[1], args[2], args[3], args[4]); default: implMissing(__FILE__, __LINE__ ); + return null; } } } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/util/HashMap.d --- a/base/src/java/util/HashMap.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/util/HashMap.d Wed Mar 16 21:53:53 2011 +0900 @@ -9,25 +9,24 @@ version(Tango){ static import tango.util.container.HashMap; -} else { // Phobos -} - -private struct ObjRef { - Object obj; - static ObjRef opCall( Object obj ){ - ObjRef res; - res.obj = obj; - return res; + private struct ObjRef { + Object obj; + static ObjRef opCall( Object obj ){ + ObjRef res; + res.obj = obj; + return res; + } + public hash_t toHash(){ + return obj is null ? 0 : obj.toHash(); + } + public equals_t opEquals( ObjRef other ){ + return obj is null ? other.obj is null : obj.opEquals( other.obj ); + } + public equals_t opEquals( Object other ){ + return obj is null ? other is null : obj.opEquals( other ); + } } - public hash_t toHash(){ - return obj is null ? 0 : obj.toHash(); - } - public equals_t opEquals( ObjRef other ){ - return obj is null ? other.obj is null : obj.opEquals( other.obj ); - } - public equals_t opEquals( Object other ){ - return obj is null ? other is null : obj.opEquals( other ); - } +} else { // Phobos } class HashMap : Map { diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/util/Hashtable.d --- a/base/src/java/util/Hashtable.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/util/Hashtable.d Wed Mar 16 21:53:53 2011 +0900 @@ -64,25 +64,29 @@ Enumeration keys() { return new ObjectEnumeration( map.keys ); } - public synchronized void clear(){ - map = null; + public void clear(){ + synchronized map = null; } - public synchronized bool containsKey(Object key){ - if( auto v = key in map ){ - return true; - } - return false; - } - public synchronized bool containsKey(String key){ - return containsKey(stringcast(key)); - } - public synchronized bool containsValue(Object value){ - foreach( k, v; map ){ - if( v == value ){ + public bool containsKey(Object key){ + synchronized { + if( auto v = key in map ){ return true; } + return false; } - return false; + } + public bool containsKey(String key){ + synchronized return containsKey(stringcast(key)); + } + public bool containsValue(Object value){ + synchronized { + foreach( k, v; map ){ + if( v == value ){ + return true; + } + } + return false; + } } public Set entrySet(){ implMissing( __FILE__, __LINE__ ); @@ -92,44 +96,50 @@ implMissing( __FILE__, __LINE__ ); return 0; } - public synchronized Object get(Object key){ - if( auto v = key in map ){ - return *v; + public Object get(Object key){ + synchronized { + if( auto v = key in map ){ + return *v; + } + return null; } - return null; } public hash_t toHash(){ implMissing( __FILE__, __LINE__ ); return 0; } - public synchronized bool isEmpty(){ - return map.length is 0; + public bool isEmpty(){ + synchronized return map.length is 0; } public Set keySet(){ implMissing( __FILE__, __LINE__ ); return null; } - public synchronized Object put(Object key, Object value){ - Object res = null; - if( auto v = key in map ){ - res = *v; + public Object put(Object key, Object value){ + synchronized { + Object res = null; + if( auto v = key in map ){ + res = *v; + } + map[ key ] = value; + return res; } - map[ key ] = value; - return res; } // public Object put(String key, Object value) // public Object put(Object key, String value) // public Object put(String key, String value) - public synchronized void putAll(Map t){ + public void putAll(Map t){ + synchronized implMissing( __FILE__, __LINE__ ); } - public synchronized Object remove(Object key){ + public Object remove(Object key){ + synchronized implMissing( __FILE__, __LINE__ ); return null; } // public Object remove(String key) - public synchronized int size(){ - return map.length; + public int size(){ + synchronized return map.length; } public Collection values(){ implMissing( __FILE__, __LINE__ ); diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/util/LinkedList.d --- a/base/src/java/util/LinkedList.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/util/LinkedList.d Wed Mar 16 21:53:53 2011 +0900 @@ -86,7 +86,6 @@ list.clear(); } else { // Phobos implMissing( __FILE__, __LINE__ ); - return false; } } Object clone(){ diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/util/Random.d --- a/base/src/java/util/Random.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/util/Random.d Wed Mar 16 21:53:53 2011 +0900 @@ -25,7 +25,8 @@ version(Tango){ return kiss.toInt(2) is 0; } else { // Phobos - return (gen.next() & 1 ) is 0; + gen.popFront(); + return (gen.front() & 1 ) is 0; } } } diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/util/ResourceBundle.d --- a/base/src/java/util/ResourceBundle.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/util/ResourceBundle.d Wed Mar 16 21:53:53 2011 +0900 @@ -13,6 +13,7 @@ import tango.io.device.File; import tango.text.locale.Core; } else { // Phobos + import std.file; } @@ -182,7 +183,7 @@ version(Tango){ return new ResourceBundle( cast(String) File.get(name) ); } else { // Phobos - implMissing(__FILE__,__LINE__); + return new ResourceBundle( cast(String) std.file.read(name) ); } } catch( IOException e){ diff -r b6e9904989ed -r 9f4c18c268b2 base/src/java/util/zip/InflaterInputStream.d --- a/base/src/java/util/zip/InflaterInputStream.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/util/zip/InflaterInputStream.d Wed Mar 16 21:53:53 2011 +0900 @@ -6,7 +6,7 @@ import java.lang.all; import java.io.InputStream; version(Tango){ - import tango.io.stream.Zlib; + import tango.io.compress.ZlibStream; import tango.io.device.Conduit; version(Windows){ pragma(lib,"zlib.lib"); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.d Wed Mar 16 21:53:53 2011 +0900 @@ -59,7 +59,7 @@ public static void main(String [] args) { Display display = new Display(); - final Shell shell = new Shell(display); + Shell shell = new Shell(display); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 3; shell.setLayout(gridLayout); @@ -82,7 +82,7 @@ Label labelAddress = new Label(shell, SWT.NONE); labelAddress.setText("Address"); - final Text location = new Text(shell, SWT.BORDER); + Text location = new Text(shell, SWT.BORDER); data = new GridData(); data.horizontalAlignment = GridData.FILL; data.horizontalSpan = 2; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet130a.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet130a.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet130a.d Wed Mar 16 21:53:53 2011 +0900 @@ -33,10 +33,15 @@ import java.lang.all; -//import tango.core.Thread; -import tango.io.Stdout; -import tango.util.Convert; -import tango.util.log.Trace; +version(Tango){ + //import tango.core.Thread; + import tango.io.Stdout; + import tango.util.Convert; + import tango.util.log.Trace; +} else { // Phobos + import std.conv; + import std.stdio; +} void main(String[] args){ @@ -66,7 +71,11 @@ display.syncExec( dgRunnable( &printStart, text, id )); for (int i = 0; i < 6; i++) { if (display.isDisposed()) return; - Trace.formatln("do task that takes a long time in a separate thread {} {}/6", id, i); + version(Tango){ + Trace.formatln("do task that takes a long time in a separate thread {} {}/6", id, i); + } else { // Phobos + writefln("do task that takes a long time in a separate thread %s %s/6", id, i); + } Thread.sleep(500); } /* @@ -101,14 +110,22 @@ } display.dispose(); } - private void printStart(Text text, int id ) { + private static void printStart(Text text, int id ) { if (text.isDisposed()) return; - Trace.formatln( "Start long running task {}", id ); - text.append("\nStart long running task "~to!(char[])(id)); + version(Tango){ + Trace.formatln( "Start long running task {}", id ); + } else { // Phobos + writefln( "Start long running task %s", id ); + } + text.append("\nStart long running task "~to!(String)(id)); } - private void printEnd(Text text, int id ) { + private static void printEnd(Text text, int id ) { if (text.isDisposed()) return; - Trace.formatln( "Completed long running task {}", id ); - text.append("\nCompleted long running task "~to!(char[])(id)); + version(Tango){ + Trace.formatln( "Completed long running task {}", id ); + } else { // Phobos + writefln( "Completed long running task %s", id ); + } + text.append("\nCompleted long running task "~to!(String)(id)); } } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet133.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet133.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet133.d Wed Mar 16 21:53:53 2011 +0900 @@ -52,8 +52,14 @@ // tango //import tango.core.Thread; -import tango.io.device.File; -import tango.text.Unicode; +version(Tango){ + import tango.io.device.File; + import tango.text.Unicode; +} else { // Phobos + import std.file; + import std.ctype; + alias isprint isPrintable; +} public void main(String[] args){ @@ -160,7 +166,11 @@ try{ try{ - textString = cast(char[])File.get(name); + version(Tango){ + textString = cast(char[])File.get(name); + } else { // Phobos + textString = cast(String)std.file.read(name); + } } catch (IOException e){ MessageBox box = new MessageBox(shell, SWT.ICON_ERROR); @@ -240,7 +250,7 @@ printer.dispose(); } public - this(char[] o_name){ + this(String o_name){ //this.name = o_name; super(&run); } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet136.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet136.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet136.d Wed Mar 16 21:53:53 2011 +0900 @@ -31,7 +31,11 @@ import java.lang.all; -import tango.io.Console; +version(Tango){ + import tango.io.Console; +} else { // Phobos + import std.stdio; +} version(linux) { version(build) @@ -53,7 +57,11 @@ try { browser = new Browser(shell, SWT.NONE); } catch (SWTError e) { - Cout("Could not instatiate Browser.").newline; + version(Tango){ + Cout("Could not instatiate Browser.").newline; + } else { // Phobos + writeln("Could not instatiate Browser."); + } return; } browser.setText(html); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet14.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet14.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet14.d Wed Mar 16 21:53:53 2011 +0900 @@ -26,7 +26,11 @@ import java.lang.all; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main (String [] args) { Display display = new Display (); @@ -34,20 +38,32 @@ shell.setSize (100, 100); shell.addListener (SWT.MouseEnter, new class() Listener{ public void handleEvent (Event e) { - Stdout("ENTER\n"); - Stdout.flush(); + version(Tango){ + Stdout("ENTER\n"); + Stdout.flush(); + } else { // Phobos + writeln("ENTER"); + } } }); shell.addListener (SWT.MouseExit, new class() Listener{ public void handleEvent (Event e) { - Stdout("EXIT\n"); - Stdout.flush(); + version(Tango){ + Stdout("EXIT\n"); + Stdout.flush(); + } else { // Phobos + writeln("EXIT"); + } } }); shell.addListener (SWT.MouseHover, new class() Listener{ public void handleEvent (Event e) { - Stdout("HOVER\n"); - Stdout.flush(); + version(Tango){ + Stdout("HOVER\n"); + Stdout.flush(); + } else { // Phobos + writeln("HOVER"); + } } }); shell.open (); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet140.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet140.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet140.d Wed Mar 16 21:53:53 2011 +0900 @@ -33,8 +33,13 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridData; +import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} static Display display; static Shell shell; @@ -53,7 +58,7 @@ for (int j = 0; j < 5; j++) { int width = 0; ToolItem item = new ToolItem(toolBar, SWT.PUSH); - item.setText("B" ~ to!(char[])(j)); + item.setText("B" ~ to!(String)(j)); width = item.getWidth(); /* find the width of the widest tool */ if (width > minWidth) minWidth = width; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet142.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet142.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet142.d Wed Mar 16 21:53:53 2011 +0900 @@ -30,8 +30,12 @@ import java.lang.all; -//import tango.core.Thread; -import tango.io.Stdout; +version(Tango){ + //import tango.core.Thread; + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main(String[] args) { Display display = new Display(); @@ -42,7 +46,11 @@ shell.pack(); shell.open(); button.addListener(SWT.MouseDown, dgListener( (Event e){ - Stdout.formatln("Mouse Down (Button: {} x: {} y: {})",e.button,e.x,e.y); + version(Tango){ + Stdout.formatln("Mouse Down (Button: {} x: {} y: {})",e.button,e.x,e.y); + } else { // Phobos + writefln("Mouse Down (Button: %s x: %s y: %s)",e.button,e.x,e.y); + } })); Point pt = display.map(shell, null, 50, 50); Thread thread = new Thread({ diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.d Wed Mar 16 21:53:53 2011 +0900 @@ -30,49 +30,83 @@ import org.eclipse.swt.widgets.TrayItem; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Event; -import tango.io.Stdout; -import tango.text.convert.Format; +import java.lang.all; +version(Tango){ + import tango.io.Stdout; + import tango.text.convert.Format; +} else { // Phobos + import std.stdio; + import std.string; +} TrayItem item; Menu menu; -public static void main(char[][] args) { +void main(String[] args) { Display display = new Display (); Shell shell = new Shell (display); Image image = new Image (display, 16, 16); - final Tray tray = display.getSystemTray (); + Tray tray = display.getSystemTray (); if (tray is null) { - Stdout.formatln ("The system tray is not available"); + version(Tango){ + Stdout.formatln ("The system tray is not available"); + } else { // Phobos + writefln("The system tray is not available"); + } } else { item = new TrayItem (tray, SWT.NONE); item.setToolTipText("SWT TrayItem"); item.addListener (SWT.Show, new class() Listener { public void handleEvent (Event event) { - Stdout.formatln("show"); + version(Tango){ + Stdout.formatln("show"); + } else { // Phobos + writefln("show"); + } } }); item.addListener (SWT.Hide, new class() Listener { public void handleEvent (Event event) { - Stdout.formatln("hide"); + version(Tango){ + Stdout.formatln("hide"); + } else { // Phobos + writefln("hide"); + } } }); item.addListener (SWT.Selection, new class() Listener { public void handleEvent (Event event) { - Stdout.formatln("selection"); + version(Tango){ + Stdout.formatln("selection"); + } else { // Phobos + writefln("selection"); + } } }); item.addListener (SWT.DefaultSelection, new class() Listener { public void handleEvent (Event event) { - Stdout.formatln("default selection"); + version(Tango){ + Stdout.formatln("default selection"); + } else { // Phobos + writefln("default selection"); + } } }); menu = new Menu (shell, SWT.POP_UP); for (int i = 0; i < 8; i++) { MenuItem mi = new MenuItem (menu, SWT.PUSH); - mi.setText ( Format( "Item{}", i )); + version(Tango){ + mi.setText ( Format( "Item{}", i )); + } else { // Phobos + mi.setText ( format( "Item%s", i )); + } mi.addListener (SWT.Selection, new class() Listener { public void handleEvent (Event event) { - Stdout.formatln("selection {}", event.widget); + version(Tango){ + Stdout.formatln("selection {}", event.widget); + } else { // Phobos + writefln("selection %s", event.widget); + } } }); if (i == 0) menu.setDefaultItem(mi); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet144.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet144.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet144.d Wed Mar 16 21:53:53 2011 +0900 @@ -31,10 +31,17 @@ import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.layout.RowData; +import java.lang.all; -import tango.io.Stdout; -import tango.time.StopWatch; -import tango.util.Convert; +version(Tango){ + import tango.io.Stdout; + import tango.time.StopWatch; + import tango.util.Convert; +} else { + import std.stdio; + import std.datetime; + import std.conv; +} const int COUNT = 1000000; @@ -47,8 +54,12 @@ public void handleEvent (Event event) { auto item = cast(TableItem) event.item; auto index = table.indexOf (item); - item.setText ("Item " ~ to!(char[])(index)); - Stdout(item.getText ()).newline; + item.setText ("Item " ~ to!(String)(index)); + version(Tango){ + Stdout(item.getText ()).newline; + } else { // Phobos + writeln(item.getText ()); + } } }); table.setLayoutData (new RowData (200, 200)); @@ -57,12 +68,20 @@ auto label = new Label(shell, SWT.NONE); button.addListener (SWT.Selection, new class Listener { public void handleEvent (Event event) { - StopWatch elapsed; - elapsed.start; - table.setItemCount (COUNT); - auto t = elapsed.stop; - label.setText ("Items: " ~ to!(char[])(COUNT) ~ - ", Time: " ~ to!(char[])(t) ~ " (sec)"); + version(Tango){ + StopWatch elapsed; + elapsed.start; + table.setItemCount (COUNT); + auto t = elapsed.stop; + } else { // Phobos + StopWatch elapsed; + elapsed.start; + table.setItemCount (COUNT); + elapsed.stop; + auto t = elapsed.peek.msecs; + } + label.setText ("Items: " ~ to!(String)(COUNT) ~ + ", Time: " ~ to!(String)(t) ~ " (sec)"); shell.layout (); } }); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet146.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet146.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet146.d Wed Mar 16 21:53:53 2011 +0900 @@ -28,8 +28,14 @@ import java.lang.all; -//import tango.core.Thread; -import tango.text.Unicode; +version(Tango){ + //import tango.core.Thread; + import tango.text.Unicode; +} else { + import std.string; + import std.uni; + alias isUniUpper isUpper; +} void main(String[] args) { Display display = new Display(); @@ -41,11 +47,15 @@ Thread thread = new Thread({ String string = "Love the method."; String lstring; - lstring. length = string.length; - toLower(string, lstring); + version(Tango){ + lstring. length = string.length; + toLower(string, lstring); + } else { + lstring = tolower(string); + } for (int i = 0; i < string.length; i++) { char ch = string.charAt(i); - bool shift = isUpper(ch); + bool shift = cast(bool) isUpper(ch); ch = lstring.charAt(i); if (shift) { Event event = new Event(); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet147.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet147.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet147.d Wed Mar 16 21:53:53 2011 +0900 @@ -29,7 +29,11 @@ import org.eclipse.swt.widgets.Shell; import java.lang.all; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main(String[] args) { Display display = new Display(); @@ -40,7 +44,11 @@ combo.setText("Here is some text"); combo.addSelectionListener(new class() SelectionAdapter{ public void widgetDefaultSelected(SelectionEvent e) { - Stdout("Combo default selected (overrides default button)\n"); + version(Tango){ + Stdout("Combo default selected (overrides default button)\n"); + } else { // Phobos + writeln("Combo default selected (overrides default button)"); + } } }); combo.addTraverseListener(new class() TraverseListener{ @@ -55,7 +63,11 @@ button.setText("Ok"); button.addSelectionListener(new class() SelectionAdapter{ public void widgetSelected(SelectionEvent e) { - Stdout("Button selected\n"); + version(Tango){ + Stdout("Button selected\n"); + } else { // Phobos + writeln("Button selected"); + } } }); shell.setDefaultButton(button); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet15.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet15.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet15.d Wed Mar 16 21:53:53 2011 +0900 @@ -24,8 +24,13 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; +import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main () { auto display = new Display (); @@ -34,16 +39,16 @@ auto tree = new Tree (shell, SWT.BORDER); for (int i=0; i<4; i++) { auto iItem = new TreeItem (tree, 0); - iItem.setText ("TreeItem (0) -" ~ to!(char[])(i)); + iItem.setText ("TreeItem (0) -" ~ to!(String)(i)); for (int j=0; j<4; j++) { TreeItem jItem = new TreeItem (iItem, 0); - jItem.setText ("TreeItem (1) -" ~ to!(char[])(j)); + jItem.setText ("TreeItem (1) -" ~ to!(String)(j)); for (int k=0; k<4; k++) { TreeItem kItem = new TreeItem (jItem, 0); - kItem.setText ("TreeItem (2) -" ~ to!(char[])(k)); + kItem.setText ("TreeItem (2) -" ~ to!(String)(k)); for (int l=0; l<4; l++) { TreeItem lItem = new TreeItem (kItem, 0); - lItem.setText ("TreeItem (3) -" ~ to!(char[])(l)); + lItem.setText ("TreeItem (3) -" ~ to!(String)(l)); } } } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet150.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet150.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet150.d Wed Mar 16 21:53:53 2011 +0900 @@ -35,15 +35,20 @@ import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormAttachment; +import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} int itemCount; CoolItem createItem(CoolBar coolBar, int count) { ToolBar toolBar = new ToolBar(coolBar, SWT.FLAT); for (int i = 0; i < count; i++) { ToolItem item = new ToolItem(toolBar, SWT.PUSH); - item.setText(to!(char[])(itemCount++) ~""); + item.setText(to!(String)(itemCount++) ~""); } toolBar.pack(); Point size = toolBar.getSize(); @@ -57,7 +62,7 @@ void main () { Display display = new Display(); - final Shell shell = new Shell(display); + Shell shell = new Shell(display); CoolBar coolBar = new CoolBar(shell, SWT.NONE); createItem(coolBar, 3); createItem(coolBar, 2); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet152.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet152.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet152.d Wed Mar 16 21:53:53 2011 +0900 @@ -32,6 +32,7 @@ import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormAttachment; +import java.lang.all; void main() { Display display = new Display(); @@ -79,7 +80,7 @@ fileMenu.addListener(SWT.Hide, hideListener); fileMenu.addListener(SWT.Show, showListener); fileItem.setMenu(fileMenu); - char[][] fileStrings = [ "New", "Close", "Exit" ]; + String[] fileStrings = [ "New", "Close", "Exit" ]; for (int i = 0; i < fileStrings.length; i++) { MenuItem item = new MenuItem(fileMenu, SWT.PUSH); item.setText(fileStrings[i]); @@ -88,7 +89,7 @@ Menu editMenu = new Menu(shell, SWT.DROP_DOWN); editMenu.addListener(SWT.Hide, hideListener); editMenu.addListener(SWT.Show, showListener); - char[][] editStrings = [ "Cut", "Copy", "Paste" ]; + String[] editStrings = [ "Cut", "Copy", "Paste" ]; editItem.setMenu(editMenu); for (int i = 0; i < editStrings.length; i++) { MenuItem item = new MenuItem(editMenu, SWT.PUSH); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet153.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet153.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet153.d Wed Mar 16 21:53:53 2011 +0900 @@ -27,8 +27,9 @@ import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolItem; import org.eclipse.swt.widgets.Label; +import java.lang.all; -static char[] statusText = ""; +static String statusText = ""; void main() { Display display = new Display(); Shell shell = new Shell(display); @@ -43,7 +44,7 @@ bar.addMouseMoveListener(new class MouseMoveListener { void mouseMove(MouseEvent e) { ToolItem item = bar.getItem(new Point(e.x, e.y)); - char[] name = ""; + String name = ""; if (item !is null) { name = item.getText(); } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet16.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet16.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet16.d Wed Mar 16 21:53:53 2011 +0900 @@ -25,22 +25,34 @@ import java.lang.all; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); - final int time = 500; + int time = 500; Runnable timer; timer = dgRunnable( { Point point = display.getCursorLocation (); Rectangle rect = shell.getBounds (); - if (rect.contains (point)) { - Stdout("In\n"); - } else { - Stdout("Out\n"); + version(Tango){ + if (rect.contains (point)) { + Stdout("In\n"); + } else { + Stdout("Out\n"); + } + Stdout.flush(); + } else { // Phobos + if (rect.contains (point)) { + writeln("In"); + } else { + writeln("Out"); + } } - Stdout.flush(); display.timerExec (time, timer); }); display.timerExec (time, timer); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet162.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet162.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet162.d Wed Mar 16 21:53:53 2011 +0900 @@ -46,15 +46,15 @@ public class Snippet162 { - final static String STATE = "CheckedIndices"; + const static String STATE = "CheckedIndices"; public static void main (String [] args) { - final Display display = new Display (); + Display display = new Display (); Image checkedImage = getCheckedImage (display); Image uncheckedImage = getUncheckedImage (display); Shell shell = new Shell (display); shell.setLayout (new FillLayout ()); - final Table table = new Table (shell, SWT.BORDER); + Table table = new Table (shell, SWT.BORDER); TableColumn column1 = new TableColumn (table, SWT.NONE); TableColumn column2 = new TableColumn (table, SWT.NONE); TableColumn column3 = new TableColumn (table, SWT.NONE); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet165.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet165.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet165.d Wed Mar 16 21:53:53 2011 +0900 @@ -33,8 +33,13 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main () { auto display = new Display (); @@ -54,10 +59,10 @@ folder.setUnselectedCloseVisible(false); for (int i = 0; i < 8; i++) { CTabItem item = new CTabItem(folder, SWT.CLOSE); - item.setText("Item " ~ to!(char[])(i)); + item.setText("Item " ~ to!(String)(i)); item.setImage(image); Text text = new Text(folder, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); - text.setText("Text for item " ~ to!(char[])(i) ~ + text.setText("Text for item " ~ to!(String)(i) ~ "\n\none, two, three\n\nabcdefghijklmnop"); item.setControl(text); } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet169.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet169.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet169.d Wed Mar 16 21:53:53 2011 +0900 @@ -31,7 +31,11 @@ import org.eclipse.swt.layout.FillLayout; import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main(String[] args){ Snippet169.main(args); @@ -41,7 +45,7 @@ public class Snippet169 { public static void main (String [] args) { Display display = new Display (); - final Shell shell = new Shell (display); + Shell shell = new Shell (display); shell.setLayout (new FillLayout ()); Listener listener = new class() Listener { public void handleEvent (Event e) { @@ -57,7 +61,7 @@ }; for (int i=0; i<20; i++) { Button button = new Button (shell, SWT.TOGGLE); - button.setText ("B" ~to!(char[])(i)); + button.setText ("B" ~to!(String)(i)); button.addListener (SWT.Selection, listener); if (i == 0) button.setSelection (true); } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet170.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet170.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet170.d Wed Mar 16 21:53:53 2011 +0900 @@ -29,13 +29,17 @@ import org.eclipse.swt.widgets.TreeColumn; import org.eclipse.swt.layout.FillLayout; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} import java.lang.all; void main() { Display display = new Display(); - final Shell shell = new Shell(display); + Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Tree tree = new Tree(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); tree.setHeaderVisible(true); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet174.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet174.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet174.d Wed Mar 16 21:53:53 2011 +0900 @@ -39,7 +39,11 @@ import derelict.opengl.gl; import derelict.opengl.glu; -import Math = tango.math.Math; +version(Tango){ + import Math = tango.math.Math; +} else { // Phobos + import Math = std.algorithm; +} public static void main() { @@ -52,7 +56,7 @@ shell.setLayout(new FillLayout()); GLData data = new GLData(); data.doubleBuffer = true; - final GLCanvas canvas = new GLCanvas(shell, SWT.NO_BACKGROUND, data); + GLCanvas canvas = new GLCanvas(shell, SWT.NO_BACKGROUND, data); canvas.addControlListener(new class ControlAdapter { public void controlResized(ControlEvent e) { resize(canvas); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet190.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet190.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet190.d Wed Mar 16 21:53:53 2011 +0900 @@ -20,8 +20,13 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridLayout; -import Math = tango.math.Math; -import tango.io.Stdout; +version(Tango){ + import Math = tango.math.Math; + import tango.io.Stdout; +} else { // Phobos + import Math = std.math; + import std.stdio; +} /* * Floating point values in Spinner @@ -37,7 +42,7 @@ Shell shell = new Shell (display); shell.setText("Spinner with float values"); shell.setLayout(new GridLayout()); - final Spinner spinner = new Spinner(shell, SWT.NONE); + Spinner spinner = new Spinner(shell, SWT.NONE); // allow 3 decimal places spinner.setDigits(3); // set the minimum value to 0.001 @@ -52,7 +57,11 @@ public void widgetSelected(SelectionEvent e) { int selection = spinner.getSelection(); float digits = spinner.getDigits(); - Stdout.formatln("Selection is {}", selection / Math.pow(10.f, digits)); + version(Tango){ + Stdout.formatln("Selection is {}", selection / Math.pow(10.f, digits)); + } else { // Phobos + writefln("Selection is %s", selection / Math.pow(10.f, digits)); + } } }); shell.setSize(200, 200); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet193.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet193.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet193.d Wed Mar 16 21:53:53 2011 +0900 @@ -32,8 +32,13 @@ import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.layout.RowData; -import tango.util.Convert; -import tango.io.Stdout; +version(Tango){ + import tango.util.Convert; + import tango.io.Stdout; +} else { // Phobos + import std.conv; + import std.stdio; +} import java.lang.all; @@ -42,7 +47,7 @@ Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new RowLayout(SWT.HORIZONTAL)); - final Tree tree = new Tree(shell, SWT.BORDER | SWT.CHECK); + Tree tree = new Tree(shell, SWT.BORDER | SWT.CHECK); tree.setLayoutData(new RowData(-1, 300)); tree.setHeaderVisible(true); TreeColumn column = new TreeColumn(tree, SWT.LEFT); @@ -87,7 +92,11 @@ } Listener listener = new class Listener { public void handleEvent(Event e) { - Stdout.print("Move "~e.widget.toString).newline; + version(Tango){ + Stdout.print("Move "~e.widget.toString).newline; + } else { + writeln("Move "~e.widget.toString); + } } }; TreeColumn[] columns = tree.getColumns(); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet195.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet195.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet195.d Wed Mar 16 21:53:53 2011 +0900 @@ -37,7 +37,11 @@ import derelict.opengl.gl; import derelict.opengl.glu; -import Math = tango.math.Math; +version(Tango){ + import Math = tango.math.Math; +} else { // Phobos + import Math = std.math; +} void drawTorus(float r, float R, int nsides, int rings) { diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet20.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet20.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet20.d Wed Mar 16 21:53:53 2011 +0900 @@ -25,8 +25,13 @@ import org.eclipse.swt.widgets.CoolBar; import org.eclipse.swt.widgets.CoolItem; import org.eclipse.swt.widgets.Shell; +import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main () { auto display = new Display (); @@ -35,7 +40,7 @@ for (int i=0; i<2; i++) { auto item = new CoolItem (bar, SWT.NONE); auto button = new Button (bar, SWT.PUSH); - button.setText ("Button " ~ to!(char[])(i)); + button.setText ("Button " ~ to!(String)(i)); auto size = button.computeSize (SWT.DEFAULT, SWT.DEFAULT); item.setPreferredSize (item.computeSize (size.x, size.y)); item.setControl (button); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet207.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet207.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet207.d Wed Mar 16 21:53:53 2011 +0900 @@ -31,7 +31,11 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Canvas; -import Math=tango.math.Math; +version(Tango){ + import Math=tango.math.Math; +} else { // Phobos + import Math=std.math; +} void main() { Display display = new Display(); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet21.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet21.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet21.d Wed Mar 16 21:53:53 2011 +0900 @@ -28,20 +28,24 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Canvas; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} import java.lang.all; void main () { Display display = new Display (); - final Color red = display.getSystemColor (SWT.COLOR_RED); - final Color blue = display.getSystemColor (SWT.COLOR_BLUE); + Color red = display.getSystemColor (SWT.COLOR_RED); + Color blue = display.getSystemColor (SWT.COLOR_BLUE); Shell shell = new Shell (display); Button b = new Button (shell, SWT.PUSH); b.setBounds (10, 10, 100, 32); b.setText ("Button"); shell.setDefaultButton (b); - final Canvas c = new Canvas (shell, SWT.BORDER); + Canvas c = new Canvas (shell, SWT.BORDER); c.setBounds (10, 50, 100, 32); void onTraverse(Event e, Canvas c) { @@ -67,7 +71,11 @@ } void onKeyDown (Event e, Canvas c) { - Stdout("KEY").newline; + version(Tango){ + Stdout("KEY").newline; + } else { // Phobos + writeln("KEY"); + } for (int i=0; i<64; i++) { Color c1 = red, c2 = blue; if (c.isFocusControl ()) { diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet212.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet212.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet212.d Wed Mar 16 21:53:53 2011 +0900 @@ -69,7 +69,7 @@ import org.eclipse.swt.graphics.GlyphMetrics; import java.lang.all; -const char[] OBJ_MARKER = "\uFFFC"; +const String OBJ_MARKER = "\uFFFC"; void main() { static StyledText styledText; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet214.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet214.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet214.d Wed Mar 16 21:53:53 2011 +0900 @@ -37,7 +37,11 @@ import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} static Image oldImage; void main(String [] args) { @@ -54,7 +58,7 @@ group.setLayout (layout2); for (int i=0; i<8; i++) { Button button = new Button (group, SWT.RADIO); - button.setText ("Button " ~ to!(char[])(i)); + button.setText ("Button " ~ to!(String)(i)); } shell.addListener (SWT.Resize, new class() Listener { public void handleEvent (Event event) { diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215.d Wed Mar 16 21:53:53 2011 +0900 @@ -34,8 +34,8 @@ Image image; void main() { - final Display display = new Display(); - final Shell shell = new Shell(display); + Display display = new Display(); + Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Button button = new Button(shell, SWT.PUSH); button.setText("Capture"); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet217.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet217.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet217.d Wed Mar 16 21:53:53 2011 +0900 @@ -48,7 +48,7 @@ import jive.stacktrace; } -const char[] OBJ_MARKER = "\uFFFC"; +const String OBJ_MARKER = "\uFFFC"; void main() { static StyledText styledText; static String text = diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet218.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet218.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet218.d Wed Mar 16 21:53:53 2011 +0900 @@ -37,7 +37,12 @@ import java.lang.all; -import Math = tango.math.Math; +version(Tango){ + import Math = tango.math.Math; +} else { // Phobos + import Math = std.algorithm; +} + version(JIVE){ import jive.stacktrace; } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet220.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet220.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet220.d Wed Mar 16 21:53:53 2011 +0900 @@ -33,8 +33,13 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; +import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} version(JIVE){ import jive.stacktrace; @@ -78,7 +83,7 @@ item.setText("root item"); for (int i = 0; i < 4; i++) { TreeItem newItem = new TreeItem(item, SWT.NONE); - newItem.setText("descendent " ~ to!(char[])(i)); + newItem.setText("descendent " ~ to!(String)(i)); if (i % 2 == 0) newItem.setData(xImage); item.setExpanded(true); item = newItem; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet222.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet222.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet222.d Wed Mar 16 21:53:53 2011 +0900 @@ -39,9 +39,11 @@ import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.TextLayout; import org.eclipse.swt.graphics.GlyphMetrics; -import tango.text.Text; -alias Text!(char) StringBuffer; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} import java.lang.all; version(JIVE){ @@ -56,13 +58,13 @@ StyledText styledText = new StyledText (shell, SWT.FULL_SELECTION | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL); StringBuffer text = new StringBuffer(); text.append("Here is StyledText with some bulleted lists:\n\n"); - for (int i = 0; i < 4; i++) text.append("Red Bullet List Item " ~ to!(char[])(i) ~ "\n"); + for (int i = 0; i < 4; i++) text.append("Red Bullet List Item " ~ to!(String)(i) ~ "\n"); text.append("\n"); - for (int i = 0; i < 2; i++) text.append("Numbered List Item " ~ to!(char[])(i) ~ "\n"); - for (int i = 0; i < 4; i++) text.append("Sub List Item " ~ to!(char[])(i) ~ "\n"); - for (int i = 0; i < 2; i++) text.append("Numbered List Item " ~ to!(char[])(2+i) ~ "\n"); + for (int i = 0; i < 2; i++) text.append("Numbered List Item " ~ to!(String)(i) ~ "\n"); + for (int i = 0; i < 4; i++) text.append("Sub List Item " ~ to!(String)(i) ~ "\n"); + for (int i = 0; i < 2; i++) text.append("Numbered List Item " ~ to!(String)(2+i) ~ "\n"); text.append("\n"); - for (int i = 0; i < 4; i++) text.append("Custom Draw List Item " ~ to!(char[])(i) ~ "\n"); + for (int i = 0; i < 4; i++) text.append("Custom Draw List Item " ~ to!(String)(i) ~ "\n"); styledText.setText(text.toString()); StyleRange style0 = new StyleRange(); @@ -99,7 +101,7 @@ layout.setAscent(event.ascent); layout.setDescent(event.descent); layout.setFont(font); - layout.setText("\u2023 1." ~ to!(char[])( event.bulletIndex) ~ ")"); + layout.setText("\u2023 1." ~ to!(String)( event.bulletIndex) ~ ")"); layout.draw(event.gc, event.x + 10, event.y); layout.dispose(); } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet224.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet224.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet224.d Wed Mar 16 21:53:53 2011 +0900 @@ -31,7 +31,12 @@ import org.eclipse.swt.layout.RowLayout; import java.lang.all; -import tango.util.Convert; + +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main(String[] args){ Snippet224.main(args); @@ -45,7 +50,7 @@ shell.setLayout (new RowLayout (SWT.VERTICAL)); for (int i=0; i<8; i++) { Button button = new Button (shell, SWT.RADIO); - button.setText ("B" ~ to!(char[])(i)); + button.setText ("B" ~ to!(String)(i)); if (i == 0) button.setSelection (true); } Button button = new Button (shell, SWT.PUSH); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet226.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet226.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet226.d Wed Mar 16 21:53:53 2011 +0900 @@ -34,17 +34,21 @@ import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Event; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} import java.lang.all; void main() { - final Display display = new Display(); + Display display = new Display(); Shell shell = new Shell(display); shell.setText("Custom gradient selection for Tree"); shell.setLayout(new FillLayout()); - final Tree tree = new Tree(shell, SWT.MULTI | SWT.FULL_SELECTION); + Tree tree = new Tree(shell, SWT.MULTI | SWT.FULL_SELECTION); tree.setHeaderVisible(true); tree.setLinesVisible(true); int columnCount = 4; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet235.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet235.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet235.d Wed Mar 16 21:53:53 2011 +0900 @@ -43,7 +43,7 @@ Label label = new Label(shell, SWT.WRAP); label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); label.setText("Change a system setting and the table below will be updated."); - final Table table = new Table(shell, SWT.BORDER); + Table table = new Table(shell, SWT.BORDER); table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); TableColumn column = new TableColumn(table, SWT.NONE); column = new TableColumn(table, SWT.NONE); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet24.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet24.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet24.d Wed Mar 16 21:53:53 2011 +0900 @@ -28,7 +28,11 @@ import org.eclipse.swt.layout.RowLayout; import java.lang.all; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main (String [] args) { Display display = new Display (); @@ -40,12 +44,20 @@ text.setText ("some text"); combo.addListener (SWT.DefaultSelection, new class() Listener{ public void handleEvent (Event e) { - Stdout(e.widget.toString() ~ " - Default Selection\n"); + version(Tango){ + Stdout(e.widget.toString() ~ " - Default Selection\n"); + } else { // Phobos + writeln(e.widget.toString() ~ " - Default Selection"); + } } }); text.addListener (SWT.DefaultSelection, new class() Listener{ public void handleEvent (Event e) { - Stdout(e.widget.toString() ~ " - Default Selection\n"); + version(Tango){ + Stdout(e.widget.toString() ~ " - Default Selection\n"); + } else { // Phobos + writeln(e.widget.toString() ~ " - Default Selection"); + } } }); shell.pack (); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet245.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet245.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet245.d Wed Mar 16 21:53:53 2011 +0900 @@ -27,8 +27,8 @@ void main() { - final Display display = new Display(); - final Shell shell = new Shell(display); + Display display = new Display(); + Shell shell = new Shell(display); shell.addPaintListener(new class(shell) PaintListener { Shell shell; this(Shell s) { this.shell = s; } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet247.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet247.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet247.d Wed Mar 16 21:53:53 2011 +0900 @@ -32,7 +32,11 @@ import java.lang.all; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main (String [] args) { Display display = new Display (); @@ -55,8 +59,12 @@ button.setText("OK"); button.addSelectionListener(new class() SelectionAdapter{ public void widgetSelected(SelectionEvent e) { - Stdout("OK selected\n"); - Stdout.flush(); + version(Tango){ + Stdout("OK selected\n"); + Stdout.flush(); + } else { + writeln("OK selected"); + } } }); shell.setDefaultButton(button); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet25.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet25.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet25.d Wed Mar 16 21:53:53 2011 +0900 @@ -25,12 +25,20 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Event; +import java.lang.all; -import tango.io.Stdout; -import tango.text.convert.Format; +version(Tango){ + import tango.io.Stdout; + import tango.text.convert.Format; + import tango.util.Convert; +} else { // Phobos + import std.stdio; + import std.string; + import std.conv; +} -static char[] stateMask (int stateMask) { - char[] string = ""; +static String stateMask (int stateMask) { + String string = ""; if ((stateMask & SWT.CTRL) != 0) string ~= " CTRL"; if ((stateMask & SWT.ALT) != 0) string ~= " ALT"; if ((stateMask & SWT.SHIFT) != 0) string ~= " SHIFT"; @@ -38,7 +46,7 @@ return string; } -static char[] character (char character) { +static String character (wchar character) { switch (character) { case 0: return "'\\0'"; case SWT.BS: return "'\\b'"; @@ -48,11 +56,11 @@ case SWT.LF: return "'\\n'"; case SWT.TAB: return "'\\t'"; default: - return "'" ~ character ~"'"; + return to!(String)("'"w ~ character ~"'"w); } } -static char[] keyCode (int keyCode) { +static String keyCode (int keyCode) { switch (keyCode) { /* Keyboard and Mouse Masks */ @@ -136,11 +144,18 @@ Shell shell = new Shell (display); Listener listener = new class Listener { public void handleEvent (Event e) { - char[] string = e.type == SWT.KeyDown ? "DOWN:" : "UP :"; - string ~= Format("stateMask=0x{:x}{},", e.stateMask, stateMask (e.stateMask)); - string ~= Format(" keyCode=0x{:x} {},", e.keyCode, keyCode (e.keyCode)); - string ~= Format(" character=0x{:x} {}", e.character, character (e.character)); - Stdout.formatln (string); + String string = e.type == SWT.KeyDown ? "DOWN:" : "UP :"; + version(Tango){ + string ~= Format("stateMask=0x{:x}{},", e.stateMask, stateMask (e.stateMask)); + string ~= Format(" keyCode=0x{:x} {},", e.keyCode, keyCode (e.keyCode)); + string ~= Format(" character=0x{:x} {}", e.character, character (e.character)); + Stdout.formatln (string); + } else { // Phobos + string ~= format("stateMask=0x%x%s,", e.stateMask, stateMask (e.stateMask)); + string ~= format(" keyCode=0x%x %s,", e.keyCode, keyCode (e.keyCode)); + string ~= format(" character=0x%x %s", e.character, character (e.character)); + writefln (string); + } } }; shell.addListener (SWT.KeyDown, listener); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet250.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet250.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet250.d Wed Mar 16 21:53:53 2011 +0900 @@ -28,7 +28,11 @@ import java.lang.all; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main (String [] args) { Display display = new Display (); @@ -38,16 +42,24 @@ DateTime calendar = new DateTime (shell, SWT.CALENDAR); calendar.addSelectionListener (new class() SelectionAdapter{ void widgetSelected (SelectionEvent e) { - Stdout("calendar date changed\n"); - Stdout.flush(); + version(Tango){ + Stdout("calendar date changed\n"); + Stdout.flush(); + } else { // Phobos + writeln("calendar date changed"); + } } }); DateTime time = new DateTime (shell, SWT.TIME); time.addSelectionListener (new class() SelectionAdapter{ void widgetSelected (SelectionEvent e) { - Stdout("time changed\n"); - Stdout.flush(); + version(Tango){ + Stdout("time changed\n"); + Stdout.flush(); + } else { // Phobos + writeln("time changed"); + } } }); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet251.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet251.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet251.d Wed Mar 16 21:53:53 2011 +0900 @@ -33,7 +33,11 @@ import java.lang.all; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main (String [] args) { /* These cannot be local in the @@ -66,13 +70,22 @@ ok.setLayoutData(new GridData (SWT.FILL, SWT.CENTER, false, false)); ok.addSelectionListener (new class() SelectionAdapter{ void widgetSelected (SelectionEvent e) { - Stdout.formatln("Calendar date selected (MM/DD/YYYY) = {:d02}/{:d02}/{:d04}", - (calendar.getMonth () + 1),calendar.getDay (),calendar.getYear ()); - Stdout.formatln("Date selected (MM/YYYY)= {:d02}/{:d04}", - (date.getMonth () + 1), date.getYear ()); - Stdout.formatln("Time selected (HH:MM) = {:d02}:{:d02}", - time.getHours(), time.getMinutes()); - Stdout.flush(); + version(Tango){ + Stdout.formatln("Calendar date selected (MM/DD/YYYY) = {:d02}/{:d02}/{:d04}", + (calendar.getMonth () + 1),calendar.getDay (),calendar.getYear ()); + Stdout.formatln("Date selected (MM/YYYY)= {:d02}/{:d04}", + (date.getMonth () + 1), date.getYear ()); + Stdout.formatln("Time selected (HH:MM) = {:d02}:{:d02}", + time.getHours(), time.getMinutes()); + Stdout.flush(); + } else { // Phobos + writefln("Calendar date selected (MM/DD/YYYY) = %02d/%02d/%04d", + (calendar.getMonth () + 1),calendar.getDay (),calendar.getYear ()); + writefln("Date selected (MM/YYYY)= %02d/%04d", + (date.getMonth () + 1), date.getYear ()); + writefln("Time selected (HH:MM) = %02d:%02d", + time.getHours(), time.getMinutes()); + } dialog.close (); } }); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet258.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet258.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet258.d Wed Mar 16 21:53:53 2011 +0900 @@ -35,7 +35,11 @@ import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolItem; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main() { auto display = new Display(); @@ -52,7 +56,11 @@ item.addSelectionListener(new class SelectionAdapter { public void widgetSelected(SelectionEvent e) { text.setText(""); - Stdout("Search cancelled").newline; + version(Tango){ + Stdout("Search cancelled").newline; + } else { // Phobos + writeln("Search cancelled"); + } } }); } @@ -60,10 +68,18 @@ text.setText("Search text"); text.addSelectionListener(new class SelectionAdapter { public void widgetDefaultSelected(SelectionEvent e) { - if (e.detail == SWT.CANCEL) { - Stdout("Search cancelled").newline; - } else { - Stdout("Searching for: ")(text.getText())("...").newline; + version(Tango){ + if (e.detail == SWT.CANCEL) { + Stdout("Search cancelled").newline; + } else { + Stdout("Searching for: ")(text.getText())("...").newline; + } + } else { // Phobos + if (e.detail == SWT.CANCEL) { + writeln("Search cancelled"); + } else { + writeln("Searching for: " ~ text.getText() ~ "..."); + } } } }); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet26.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet26.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet26.d Wed Mar 16 21:53:53 2011 +0900 @@ -22,8 +22,9 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Combo; +import java.lang.all; -char[][] content = ["A", "B", "C"]; +String[] content = ["A", "B", "C"]; void main () { auto display = new Display (); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet268.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet268.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet268.d Wed Mar 16 21:53:53 2011 +0900 @@ -32,9 +32,14 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.FillLayout; -import tango.io.Stdout; -import tango.util.Convert; -//import tango.core.Thread; +version(Tango){ + import tango.io.Stdout; + import tango.util.Convert; + //import tango.core.Thread; +} else { // Phobos + import std.stdio; + import std.conv; +} void main(String[] args) { Display display = new Display(); @@ -50,10 +55,14 @@ shell.setSize(styledText.computeSize(SWT.DEFAULT, 400)); shell.open(); styledText.addListener(SWT.MouseWheel, dgListener( (Event e){ - Stdout.formatln("Mouse Wheel event \n"); //" + e); - Stdout.flush(); + version(Tango){ + Stdout.formatln("Mouse Wheel event \n"); //" + e); + Stdout.flush(); + } else { + writeln("Mouse Wheel event "); //" + e); + } })); - final Point pt = display.map(shell, null, 50, 50); + Point pt = display.map(shell, null, 50, 50); Thread thread = new Thread({ Event event; for (int i = 0; i < 50; i++) { @@ -68,7 +77,11 @@ Thread.sleep(400); } catch (InterruptedException e) {} } - Stdout("Thread done\n").flush(); + version(Tango){ + Stdout("Thread done\n").flush(); + } else { + writeln("Thread done"); + } }); thread.start(); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet275.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet275.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet275.d Wed Mar 16 21:53:53 2011 +0900 @@ -31,13 +31,17 @@ import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} static String value; public static void main () { - final int INTERVAL = 888; - final Display display = new Display (); - final Image image = new Image (display, 750, 750); + int INTERVAL = 888; + Display display = new Display (); + Image image = new Image (display, 750, 750); GC gc = new GC (image); gc.setBackground (display.getSystemColor (SWT.COLOR_RED)); gc.fillRectangle (image.getBounds ()); @@ -45,11 +49,11 @@ Shell shell = new Shell (display); shell.setBounds (10, 10, 790, 790); - final Canvas canvas = new Canvas (shell, SWT.NONE); + Canvas canvas = new Canvas (shell, SWT.NONE); canvas.setBounds (10, 10, 750, 750); void onPaint (Event event) { - value = to!(char[])(System.currentTimeMillis ()); + value = to!(String)(System.currentTimeMillis ()); event.gc.drawImage (image, 0, 0); event.gc.drawString (value, 10, 10, true); } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet276.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet276.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet276.d Wed Mar 16 21:53:53 2011 +0900 @@ -29,7 +29,11 @@ import org.eclipse.swt.widgets.Shell; import java.lang.all; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main (String[] args) { Display display = new Display (); @@ -39,7 +43,11 @@ label.setText ("click in shell to print display-relative coordinate"); Listener listener = dgListener( (Event event) { Point point = new Point (event.x, event.y); - Stdout(display.map (cast(Control)event.widget, null, point)).newline().flush(); + version(Tango){ + Stdout(display.map (cast(Control)event.widget, null, point)).newline().flush(); + } else { // Phobos + writeln(display.map (cast(Control)event.widget, null, point)); + } }); shell.addListener (SWT.MouseDown, listener); label.addListener (SWT.MouseDown, listener); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet286.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet286.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet286.d Wed Mar 16 21:53:53 2011 +0900 @@ -27,8 +27,13 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; +import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main() { @@ -51,7 +56,7 @@ for (int i = 0; i < 5; i++) { MenuItem item = new MenuItem (menu, SWT.PUSH); - item.setText ("Item " ~ to!(char[])(i)); + item.setText ("Item " ~ to!(String)(i)); item.addArmListener(new class ArmListener { public void widgetArmed(ArmEvent e) { statusLine.setText((cast(MenuItem)e.getSource()).getText()); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet288.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet288.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet288.d Wed Mar 16 21:53:53 2011 +0900 @@ -31,12 +31,24 @@ import java.lang.all; -import tango.io.FilePath; -import tango.io.model.IFile; -//import tango.core.Thread; -import tango.io.Stdout; -import tango.util.Convert; -import tango.core.Exception; +version(Tango){ + import tango.io.FilePath; + import tango.io.model.IFile; + //import tango.core.Thread; + import tango.io.Stdout; + import tango.util.Convert; + import tango.core.Exception; +} else { // Phobos + import std.path; + import std.stream; + import std.stdio; + import std.conv; + import core.exception; + import core.thread : ThreadException; + struct FileConst { + static const PathSeparatorChar = sep; + } +} static Display display; static Shell shell; @@ -47,7 +59,7 @@ static Thread[] animateThread; static Image[][] image; private static ToolItem[] item; -static final bool useGIFBackground = false; +static const bool useGIFBackground = false; void main () { display = new Display(); @@ -56,15 +68,24 @@ FileDialog dialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI); dialog.setText("Select Multiple Animated GIFs"); dialog.setFilterExtensions(["*.gif"]); - char[] filename = dialog.open(); - char[][] filenames = dialog.getFileNames(); + String filename = dialog.open(); + String[] filenames = dialog.getFileNames(); int numToolBarItems = filenames.length; if (numToolBarItems > 0) { - try { - loadAllImages((new FilePath(filename)).parent, filenames); - } catch (SWTException e) { - Stdout.print("There was an error loading an image.").newline; - e.printStackTrace(); + version(Tango){ + try { + loadAllImages((new FilePath(filename)).parent, filenames); + } catch (SWTException e) { + Stdout.print("There was an error loading an image.").newline; + e.printStackTrace(); + } + } else { // Phobos + try { + loadAllImages(filename.getDirName, filenames); + } catch (SWTException e) { + writeln("There was an error loading an image."); + e.printStackTrace(); + } } ToolBar toolBar = new ToolBar (shell, SWT.FLAT | SWT.BORDER | SWT.WRAP); item = new ToolItem[numToolBarItems]; @@ -91,7 +112,7 @@ Thread.joinAll(); } -private static void loadAllImages(char[] directory, char[][] filenames) { +private static void loadAllImages(String directory, String[] filenames) { int numItems = filenames.length; loader.length = numItems; imageDataArray.length = numItems; @@ -198,7 +219,11 @@ if (imageDataIndex == imageDataArray[id].length - 1) repeatCount--; } } catch (SWTException ex) { - Stdout.print("There was an error animating the GIF").newline; + version(Tango){ + Stdout.print("There was an error animating the GIF").newline; + } else { // Phobos + writeln("There was an error animating the GIF"); + } ex.printStackTrace(); } } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet29.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet29.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet29.d Wed Mar 16 21:53:53 2011 +0900 @@ -26,7 +26,11 @@ import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.Shell; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main () { auto display = new Display (); @@ -40,7 +44,11 @@ auto item = new MenuItem (submenu, SWT.PUSH); item.addListener (SWT.Selection, new class Listener { public void handleEvent (Event e) { - Stdout("Select All").newline; + version(Tango){ + Stdout("Select All").newline; + } else { // Phobos + writeln("Select All"); + } } }); item.setText ("Select &All\tCtrl+A"); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet290.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet290.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet290.d Wed Mar 16 21:53:53 2011 +0900 @@ -24,19 +24,31 @@ import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseAdapter; -import tango.io.Stdout; +version(Tango){ + import tango.io.Stdout; +} else { // Phobos + import std.stdio; +} void main() { - final Display display = new Display(); - final Shell shell = new Shell(display); + Display display = new Display(); + Shell shell = new Shell(display); shell.addMouseListener(new class MouseAdapter { public void mouseUp(MouseEvent e) { if (e.count == 1) { - Stdout("Mouse up").newline; + version(Tango){ + Stdout("Mouse up").newline; + } else { // Phobos + writeln("Mouse up"); + } } } public void mouseDoubleClick(MouseEvent e) { - Stdout("Double-click").newline; + version(Tango){ + Stdout("Double-click").newline; + } else { // Phobos + writeln("Double-click"); + } } }); shell.setBounds(10, 10, 200, 200); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet294.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet294.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet294.d Wed Mar 16 21:53:53 2011 +0900 @@ -24,7 +24,11 @@ import org.eclipse.swt.widgets.Shell; import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main(String[] args){ Snippet294.main(args); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet33.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet33.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet33.d Wed Mar 16 21:53:53 2011 +0900 @@ -22,18 +22,30 @@ import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; +import java.lang.all; -import tango.io.FileSystem; -import tango.io.Stdout; -import tango.util.Convert; +version(Tango){ + import tango.sys.Environment; + import tango.io.Stdout; + import tango.util.Convert; +} else { // Phobos + import std.file; + import std.stdio; + import std.conv; +} void main () { auto display = new Display (); auto shell = new Shell (display); shell.open (); auto dialog = new DirectoryDialog (shell); - dialog.setFilterPath (FileSystem.getDirectory()); - Stdout("RESULT=" ~ to!(char[])(dialog.open())).newline; + version(Tango){ + dialog.setFilterPath (Environment.cwd()); + Stdout("RESULT=" ~ to!(String)(dialog.open())).newline; + } else { + dialog.setFilterPath (getcwd()); + writeln("RESULT=" ~ to!(String)(dialog.open())); + } while (!shell.isDisposed()) { if (!display.readAndDispatch ()) display.sleep (); } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet38.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet38.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet38.d Wed Mar 16 21:53:53 2011 +0900 @@ -24,8 +24,13 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; +import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main () { auto display = new Display (); @@ -33,7 +38,7 @@ auto table = new Table (shell, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION); table.setLinesVisible (true); table.setHeaderVisible (true); - char[][] titles = [" ", "C", "!", "Description", "Resource", "In Folder", "Location"]; + String[] titles = [" ", "C", "!", "Description", "Resource", "In Folder", "Location"]; int[] styles = [SWT.NONE, SWT.LEFT, SWT.RIGHT, SWT.CENTER, SWT.NONE, SWT.NONE, SWT.NONE]; foreach (i,title; titles) { auto column = new TableColumn (table, styles[i]); @@ -48,7 +53,7 @@ item.setText (3, "this stuff behaves the way I expect"); item.setText (4, "almost everywhere"); item.setText (5, "some.folder"); - item.setText (6, "line " ~ to!(char[])(i) ~ " in nowhere"); + item.setText (6, "line " ~ to!(String)(i) ~ " in nowhere"); } for (int i=0; i 0) { - oOut.formatln("\n\nVariables :"); - for (int iIdx = 0; iIdx < pTypeAttr.cVars; ++iIdx) { - OlePropertyDescription oData = oOleAutoObj.getPropertyDescription(iIdx); - oOut.formatln("PROPERTY (id = {} (0x{:X8})", oData.id, oData.id); - oOut.formatln("\tName : {}", oData.name); - oOut.formatln("\tType : {}", getTypeName(oData.type)); - oOut.formatln(""); + version(Tango){ + oOut.formatln("\n\nVariables :"); + for (int iIdx = 0; iIdx < pTypeAttr.cVars; ++iIdx) { + OlePropertyDescription oData = oOleAutoObj.getPropertyDescription(iIdx); + oOut.formatln("PROPERTY (id = {} (0x{:X8})", oData.id, oData.id); + oOut.formatln("\tName : {}", oData.name); + oOut.formatln("\tType : {}", getTypeName(oData.type)); + oOut.formatln(""); + } + } else { // Phobos + oOut.formatln("\n\nVariables :"); + for (int iIdx = 0; iIdx < pTypeAttr.cVars; ++iIdx) { + OlePropertyDescription oData = oOleAutoObj.getPropertyDescription(iIdx); + oOut.formatln("PROPERTY (id = %s (0x%8X)", oData.id, oData.id); + oOut.formatln("\tName : %s", oData.name); + oOut.formatln("\tType : %s", getTypeName(oData.type)); + oOut.formatln(""); + } } } } } -private static char[] getTypeName(int iType) { +private static String getTypeName(int iType) { int iBase = iType & ~OLE.VT_BYREF; - char[] sDsc = null; + String sDsc = null; switch (iBase) { case OLE.VT_BOOL : sDsc = "boolean"; break; case OLE.VT_R4 : sDsc = "float"; break; @@ -147,11 +187,15 @@ } return sDsc; } - return Format("unknown {} (0x{:X4})", iType, iType); + version(Tango){ + return Format("unknown {} (0x{:X4})", iType, iType); + } else { // Phobos + return format("unknown %s (0x%4X)", iType, iType); + } } -char[] getDirection(int bDirection) { - char[] sDirString = ""; +String getDirection(int bDirection) { + String sDirString = ""; bool bComma = false; if ((bDirection & OLE.IDLFLAG_FIN) != 0) { sDirString ~= "in"; @@ -173,7 +217,7 @@ } return sDirString; } -private static char[] getInvokeKind(int iInvKind) { +private static String getInvokeKind(int iInvKind) { switch (iInvKind) { case OLE.INVOKE_FUNC : return "METHOD"; case OLE.INVOKE_PROPERTYGET : return "PROPERTY GET"; @@ -181,7 +225,11 @@ case OLE.INVOKE_PROPERTYPUTREF : return "PROPERTY PUT BY REF"; default: break; } - return Format("unknown {}", iInvKind); + version(Tango){ + return Format("unknown {}", iInvKind); + } else { // Phobos + return format("unknown %s", iInvKind); + } } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet82.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet82.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet82.d Wed Mar 16 21:53:53 2011 +0900 @@ -34,7 +34,11 @@ import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main(String[] args) { Display display = new Display(); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.d Wed Mar 16 21:53:53 2011 +0900 @@ -52,7 +52,11 @@ import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main() { @@ -61,24 +65,24 @@ shell.setLayout(new GridLayout()); // create a a table with 3 columns and fill with data - final Table table = new Table(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); + Table table = new Table(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); table.setLayoutData(new GridData(GridData.FILL_BOTH)); TableColumn column1 = new TableColumn(table, SWT.NONE); TableColumn column2 = new TableColumn(table, SWT.NONE); TableColumn column3 = new TableColumn(table, SWT.NONE); for (int i = 0; i < 100; i++) { TableItem item = new TableItem(table, SWT.NONE); - item.setText(["cell " ~ to!(char[])(i) ~ " 0", "cell " ~ to!(char[])(i) ~ " 1", "cell " ~ to!(char[])(i) ~ " 2" ]); + item.setText(["cell " ~ to!(String)(i) ~ " 0", "cell " ~ to!(String)(i) ~ " 1", "cell " ~ to!(String)(i) ~ " 2" ]); } column1.pack(); column2.pack(); column3.pack(); // create a TableCursor to navigate around the table - final TableCursor cursor = new TableCursor(table, SWT.NONE); + TableCursor cursor = new TableCursor(table, SWT.NONE); // create an editor to edit the cell when the user hits "ENTER" // while over a cell in the table - final ControlEditor editor = new ControlEditor(cursor); + ControlEditor editor = new ControlEditor(cursor); editor.grabHorizontal = true; editor.grabVertical = true; @@ -102,7 +106,7 @@ // when the user hits "ENTER" in the TableCursor, pop up a text editor so that // they can change the text of the cell public void widgetDefaultSelected(SelectionEvent e) { - final Text text = new Text(cursor, SWT.NONE); + Text text = new Text(cursor, SWT.NONE); TableItem row = cursor.getRow(); int column = cursor.getColumn(); text.setText(row.getText(column)); @@ -173,7 +177,7 @@ } public void mouseDown(MouseEvent e) { - final Text text = new Text(cursor, SWT.NONE); + Text text = new Text(cursor, SWT.NONE); TableItem row = cursor.getRow(); int column = cursor.getColumn(); text.setText(row.getText(column)); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet97.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet97.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet97.d Wed Mar 16 21:53:53 2011 +0900 @@ -28,8 +28,13 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; +import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} void main () { auto display = new Display (); @@ -39,7 +44,7 @@ tree.setMenu (menu); for (int i=0; i<12; i++) { auto item = new TreeItem (tree, SWT.NONE); - item.setText ("Item " ~ to!(char[])(i)); + item.setText ("Item " ~ to!(String)(i)); } menu.addListener (SWT.Show, new class Listener { public void handleEvent (Event event) { diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet98.d --- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet98.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet98.d Wed Mar 16 21:53:53 2011 +0900 @@ -32,14 +32,18 @@ import java.lang.all; -import tango.util.Convert; +version(Tango){ + import tango.util.Convert; +} else { // Phobos + import std.conv; +} static int pageNum = 0; static Composite pageComposite; void main(String args[]) { Display display = new Display(); - final Shell shell = new Shell(display); + Shell shell = new Shell(display); shell.setLayout(new GridLayout()); Button button = new Button(shell, SWT.PUSH); button.setText("Push"); @@ -59,7 +63,7 @@ Table table = new Table(pageComposite, SWT.BORDER); table.setLayoutData(new GridData()); for (int i = 0; i < 5; i++) { - (new TableItem(table, SWT.NONE)).setText("table item " ~ to!(char[])(i)); + (new TableItem(table, SWT.NONE)).setText("table item " ~ to!(String)(i)); } } else { (new Button(pageComposite, SWT.RADIO)).setText("radio"); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/SWT.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/SWT.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/SWT.d Wed Mar 16 21:53:53 2011 +0900 @@ -37,7 +37,7 @@ pragma(link, "msimg32"); pragma(link, "opengl32"); pragma(link, "shlwapi"); - pragma(link, "org.eclipse.swt.win32.win32.x86"); + //pragma(link, "org.eclipse.swt.win32.win32.x86"); //pragma(link, "gdiplus"); // load dynamic //pragma(link, "uxtheme"); // load dynamic } @@ -57,7 +57,7 @@ pragma(lib, "msimg32.lib"); pragma(lib, "opengl32.lib"); pragma(lib, "shlwapi.lib"); -pragma(lib, "org.eclipse.swt.win32.win32.x86.lib"); +//pragma(lib, "org.eclipse.swt.win32.win32.x86.lib"); //pragma(link, "gdiplus"); // load dynamic //pragma(link, "uxtheme"); // load dynamic diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/AnimatedProgress.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/AnimatedProgress.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/AnimatedProgress.d Wed Mar 16 21:53:53 2011 +0900 @@ -119,11 +119,13 @@ *
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  • * */ -public synchronized void clear(){ - checkWidget(); - if (active) stop(); - showStripes = false; - redraw(); +public void clear(){ + synchronized { + checkWidget(); + if (active) stop(); + showStripes = false; + redraw(); + } } public override Point computeSize(int wHint, int hHint, bool changed) { checkWidget(); @@ -208,38 +210,42 @@ *
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  • * */ -public synchronized void start() { - checkWidget(); - if (active) return; +public void start() { + synchronized { + checkWidget(); + if (active) return; - active = true; - showStripes = true; + active = true; + showStripes = true; - Display display = getDisplay(); - Runnable [] timer = new Runnable [1]; + Display display = getDisplay(); + Runnable [] timer = new Runnable [1]; - timer [0] = new class( display, timer ) Runnable { - Display disp; - Runnable [] runs; - this( Display disp, Runnable[] runs ){ - this.disp = disp; - this.runs = runs; - } - public void run () { - if (!active) return; - GC gc = new GC(this.outer); - paintStripes(gc); - gc.dispose(); - disp.timerExec (SLEEP, runs [0]); - } - }; - display.timerExec (SLEEP, timer [0]); + timer [0] = new class( display, timer ) Runnable { + Display disp; + Runnable [] runs; + this( Display disp, Runnable[] runs ){ + this.disp = disp; + this.runs = runs; + } + public void run () { + if (!active) return; + GC gc = new GC(this.outer); + paintStripes(gc); + gc.dispose(); + disp.timerExec (SLEEP, runs [0]); + } + }; + display.timerExec (SLEEP, timer [0]); + } } /** * Stop the animation. Freeze the presentation at its current appearance. */ -public synchronized void stop() { - //checkWidget(); - active = false; +public void stop() { + synchronized { + //checkWidget(); + active = false; + } } } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/CTabItem.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/CTabItem.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/CTabItem.d Wed Mar 16 21:53:53 2011 +0900 @@ -32,6 +32,14 @@ import org.eclipse.swt.widgets.Widget; import org.eclipse.swt.custom.CTabFolder; +version(Tango){ + import tango.text.convert.Utf; +} else { + import std.conv; + alias to!(string) toString; + alias to!(dstring) toString32; +} + /** * Instances of this class represent a selectable user interface object * that represent a page in a notebook widget. @@ -173,7 +181,7 @@ end = layout.getPreviousOffset(end, SWT.MOVEMENT_CLUSTER); } layout.dispose(); - return end is 0 ? text.substring(0, 1) : text ~ ellipses; + return end is 0 ? .toString(toString32(text)[0 .. 1]) : text ~ ellipses; } public override void dispose() { @@ -859,14 +867,14 @@ if (minimum) { int minChars = parent.minChars; text = minChars is 0 ? null : getText(); - if (text !is null && text.length > minChars) { + if (text !is null && toString32(text).length > minChars) { if (useEllipses()) { int end = minChars < ELLIPSIS.length + 1 ? minChars : minChars - ELLIPSIS.length; - text = text[ 0 .. end ]; + text = .toString(toString32(text)[ 0 .. end ]); if (minChars > ELLIPSIS.length + 1) text ~= ELLIPSIS; } else { int end = minChars; - text = text[ 0 .. end ]; + text = .toString(toString32(text)[ 0 .. end ]); } } } else { diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/DefaultContent.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/DefaultContent.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/DefaultContent.d Wed Mar 16 21:53:53 2011 +0900 @@ -900,7 +900,7 @@ return offset; } if (!gapExists() || (offset < gapStart)){ - while( textStore[offset] & 0xC0 is 0x80 ){ + while( (textStore[offset] & 0xC0) is 0x80 ){ offset--; } return offset; @@ -909,7 +909,7 @@ if( offset+gapLength >= textStore.length ){ return offset; } - while( textStore[offset+gapLength] & 0xC0 is 0x80 ){ + while( (textStore[offset+gapLength] & 0xC0) is 0x80 ){ offset--; } return offset; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/StyledText.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/StyledText.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/StyledText.d Wed Mar 16 21:53:53 2011 +0900 @@ -7284,14 +7284,14 @@ if (Compatibility.isLetter(keyChar)) { // make the keybinding case insensitive by adding it // in its upper and lower case form - char ch = CharacterToUpper(keyChar); + char ch = cast(char) CharacterToUpper(keyChar); int newKey = ch | modifierValue; if (action is SWT.NULL) { keyActionMap.remove(newKey); } else { keyActionMap[newKey] = action; } - ch = CharacterToLower(keyChar); + ch = cast(char) CharacterToLower(keyChar); newKey = ch | modifierValue; if (action is SWT.NULL) { keyActionMap.remove(newKey); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/ByteArrayTransfer.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/ByteArrayTransfer.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/ByteArrayTransfer.d Wed Mar 16 21:53:53 2011 +0900 @@ -136,7 +136,7 @@ data[i] = new TransferData(); data[i].type = types[i]; data[i].formatetc = new FORMATETC(); - data[i].formatetc.cfFormat = types[i]; + data[i].formatetc.cfFormat = cast(ushort) types[i]; data[i].formatetc.dwAspect = COM.DVASPECT_CONTENT; data[i].formatetc.lindex = -1; data[i].formatetc.tymed = COM.TYMED_HGLOBAL; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/Clipboard.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/Clipboard.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/Clipboard.d Wed Mar 16 21:53:53 2011 +0900 @@ -557,7 +557,7 @@ } // include the drop effect format to specify a copy operation FORMATETC* dropeffect = new FORMATETC(); - dropeffect.cfFormat = CFSTR_PREFERREDDROPEFFECT; + dropeffect.cfFormat = cast(ushort) CFSTR_PREFERREDDROPEFFECT; dropeffect.dwAspect = COM.DVASPECT_CONTENT; dropeffect.lindex = -1; dropeffect.tymed = COM.TYMED_HGLOBAL; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/TableDragSourceEffect.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/TableDragSourceEffect.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/TableDragSourceEffect.d Wed Mar 16 21:53:53 2011 +0900 @@ -132,7 +132,7 @@ OS.BitBlt (memHdc, 0, 0, srcWidth, srcHeight, srcHdc, 0, 0, OS.SRCCOPY); //byte[] srcData = new byte [sizeInBytes]; //OS.MoveMemory (srcData, dibBM.bmBits, sizeInBytes); - byte[] srcData = (cast(byte*) dibBM.bmBits)[ 0 .. BITMAPINFOHEADER.sizeof ]; + byte[] srcData = (cast(byte*) dibBM.bmBits)[ 0 .. sizeInBytes ]; PaletteData palette = new PaletteData(0xFF00, 0xFF0000, 0xFF000000); ImageData data = new ImageData(srcWidth, srcHeight, bm.bmBitsPixel, palette, bm.bmWidthBytes, srcData); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/Device.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/Device.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/Device.d Wed Mar 16 21:53:53 2011 +0900 @@ -110,11 +110,13 @@ /* * TEMPORARY CODE. */ -static synchronized Device getDevice () { - if (DeviceFinder !is null) DeviceFinder.run(); - Device device = CurrentDevice; - CurrentDevice = null; - return device; +static Device getDevice () { + synchronized { + if (DeviceFinder !is null) DeviceFinder.run(); + Device device = CurrentDevice; + CurrentDevice = null; + return device; + } } /** diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/TextLayout.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/TextLayout.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/TextLayout.d Wed Mar 16 21:53:53 2011 +0900 @@ -535,7 +535,7 @@ OS.OleUninitialize(); } -SCRIPT_ANALYSIS cloneScriptAnalysis ( inout SCRIPT_ANALYSIS src) { +SCRIPT_ANALYSIS cloneScriptAnalysis ( ref SCRIPT_ANALYSIS src) { SCRIPT_ANALYSIS dst; dst.eScript = src.eScript; dst.fRTL = src.fRTL; @@ -2960,7 +2960,7 @@ if (run.visAttrs is null) SWT.error(SWT.ERROR_NO_HANDLES); run.psc = cast(SCRIPT_CACHE*)OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, (void*).sizeof); if (run.psc is null) SWT.error(SWT.ERROR_NO_HANDLES); - short script = run.analysis.eScript; + short script = cast(short) run.analysis.eScript; SCRIPT_PROPERTIES sp = *device.scripts[script]; bool shapeSucceed = shape(hdc, run, wchars, buffer, maxGlyphs, &sp); int res; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/gdip/native.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/gdip/native.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/gdip/native.d Wed Mar 16 21:53:53 2011 +0900 @@ -1198,477 +1198,480 @@ Status function(Handle format, int hotkeyPrefix) GdipSetStringFormatHotkeyPrefix; Status function( Handle format, float firstTabOffset, int count, float* tabStops) GdipSetStringFormatTabStops; -Symbol[] symbols = [ - { "GdiplusStartup", cast(void**)& GdiplusStartup }, - { "GdiplusShutdown", cast(void**)& GdiplusShutdown }, - { "GdipCreateFromHDC", cast(void**)& GdipCreateFromHDC }, - { "GdipCreateFromHDC2", cast(void**)& GdipCreateFromHDC2 }, - { "GdipCreateFromHWND", cast(void**)& GdipCreateFromHWND }, - { "GdipGetImageGraphicsContext", cast(void**)& GdipGetImageGraphicsContext }, - { "GdipDeleteGraphics", cast(void**)& GdipDeleteGraphics }, - { "GdipGetDC", cast(void**)& GdipGetDC }, - { "GdipReleaseDC", cast(void**)& GdipReleaseDC }, - { "GdipSetClipGraphics", cast(void**)& GdipSetClipGraphics }, - { "GdipSetClipRectI", cast(void**)& GdipSetClipRectI }, - { "GdipSetClipRect", cast(void**)& GdipSetClipRect }, - { "GdipSetClipPath", cast(void**)& GdipSetClipPath }, - { "GdipSetClipRegion", cast(void**)& GdipSetClipRegion }, - { "GdipSetClipHrgn", cast(void**)& GdipSetClipHrgn }, - { "GdipGetClip", cast(void**)& GdipGetClip }, - { "GdipResetClip", cast(void**)& GdipResetClip }, - { "GdipSaveGraphics", cast(void**)& GdipSaveGraphics }, - { "GdipRestoreGraphics", cast(void**)& GdipRestoreGraphics }, - { "GdipFlush", cast(void**)& GdipFlush }, - { "GdipScaleWorldTransform", cast(void**)& GdipScaleWorldTransform }, - { "GdipRotateWorldTransform", cast(void**)& GdipRotateWorldTransform }, - { "GdipTranslateWorldTransform", cast(void**)& GdipTranslateWorldTransform }, - { "GdipMultiplyWorldTransform", cast(void**)& GdipMultiplyWorldTransform }, - { "GdipResetWorldTransform", cast(void**)& GdipResetWorldTransform }, - { "GdipBeginContainer", cast(void**)& GdipBeginContainer }, - { "GdipBeginContainerI", cast(void**)& GdipBeginContainerI }, - { "GdipBeginContainer2", cast(void**)& GdipBeginContainer2 }, - { "GdipEndContainer", cast(void**)& GdipEndContainer }, - { "GdipGetDpiX", cast(void**)& GdipGetDpiX }, - { "GdipGetDpiY", cast(void**)& GdipGetDpiY }, - { "GdipGetPageUnit", cast(void**)& GdipGetPageUnit }, - { "GdipSetPageUnit", cast(void**)& GdipSetPageUnit }, - { "GdipGetPageScale", cast(void**)& GdipGetPageScale }, - { "GdipSetPageScale", cast(void**)& GdipSetPageScale }, - { "GdipGetWorldTransform", cast(void**)& GdipGetWorldTransform }, - { "GdipSetWorldTransform", cast(void**)& GdipSetWorldTransform }, - { "GdipGetCompositingMode", cast(void**)& GdipGetCompositingMode }, - { "GdipSetCompositingMode", cast(void**)& GdipSetCompositingMode }, - { "GdipGetCompositingQuality", cast(void**)& GdipGetCompositingQuality }, - { "GdipSetCompositingQuality", cast(void**)& GdipSetCompositingQuality }, - { "GdipGetInterpolationMode", cast(void**)& GdipGetInterpolationMode }, - { "GdipSetInterpolationMode", cast(void**)& GdipSetInterpolationMode }, - { "GdipGetSmoothingMode", cast(void**)& GdipGetSmoothingMode }, - { "GdipSetSmoothingMode", cast(void**)& GdipSetSmoothingMode }, - { "GdipGetPixelOffsetMode", cast(void**)& GdipGetPixelOffsetMode }, - { "GdipSetPixelOffsetMode", cast(void**)& GdipSetPixelOffsetMode }, - { "GdipGetTextContrast", cast(void**)& GdipGetTextContrast }, - { "GdipSetTextContrast", cast(void**)& GdipSetTextContrast }, - { "GdipGraphicsClear", cast(void**)& GdipGraphicsClear }, - { "GdipDrawLine", cast(void**)& GdipDrawLine }, - { "GdipDrawLines", cast(void**)& GdipDrawLines }, - { "GdipDrawLineI", cast(void**)& GdipDrawLineI }, - { "GdipDrawLinesI", cast(void**)& GdipDrawLinesI }, - { "GdipDrawArc", cast(void**)& GdipDrawArc }, - { "GdipDrawArcI", cast(void**)& GdipDrawArcI }, - { "GdipDrawBezier", cast(void**)& GdipDrawBezier }, - { "GdipDrawBeziers", cast(void**)& GdipDrawBeziers }, - { "GdipDrawBezierI", cast(void**)& GdipDrawBezierI }, - { "GdipDrawBeziersI", cast(void**)& GdipDrawBeziersI }, - { "GdipDrawRectangle", cast(void**)& GdipDrawRectangle }, - { "GdipDrawRectangles", cast(void**)& GdipDrawRectangles }, - { "GdipDrawRectangleI", cast(void**)& GdipDrawRectangleI }, - { "GdipDrawRectanglesI", cast(void**)& GdipDrawRectanglesI }, - { "GdipDrawEllipse", cast(void**)& GdipDrawEllipse }, - { "GdipDrawEllipseI", cast(void**)& GdipDrawEllipseI }, - { "GdipDrawPie", cast(void**)& GdipDrawPie }, - { "GdipDrawPieI", cast(void**)& GdipDrawPieI }, - { "GdipDrawPolygon", cast(void**)& GdipDrawPolygon }, - { "GdipDrawPolygonI", cast(void**)& GdipDrawPolygonI }, - { "GdipDrawCurve", cast(void**)& GdipDrawCurve }, - { "GdipDrawCurve2", cast(void**)& GdipDrawCurve2 }, - { "GdipDrawCurve3", cast(void**)& GdipDrawCurve3 }, - { "GdipDrawCurveI", cast(void**)& GdipDrawCurveI }, - { "GdipDrawCurve2I", cast(void**)& GdipDrawCurve2I }, - { "GdipDrawCurve3I", cast(void**)& GdipDrawCurve3I }, - { "GdipDrawClosedCurve", cast(void**)& GdipDrawClosedCurve }, - { "GdipDrawClosedCurve2", cast(void**)& GdipDrawClosedCurve2 }, - { "GdipDrawClosedCurveI", cast(void**)& GdipDrawClosedCurveI }, - { "GdipDrawClosedCurve2I", cast(void**)& GdipDrawClosedCurve2I }, - { "GdipFillRectangleI", cast(void**)& GdipFillRectangleI }, - { "GdipFillRectangle", cast(void**)& GdipFillRectangle }, - { "GdipFillRectanglesI", cast(void**)& GdipFillRectanglesI }, - { "GdipFillRectangles", cast(void**)& GdipFillRectangles }, - { "GdipFillPolygon", cast(void**)& GdipFillPolygon }, - { "GdipFillPolygonI", cast(void**)& GdipFillPolygonI }, - { "GdipFillEllipse", cast(void**)& GdipFillEllipse }, - { "GdipFillEllipseI", cast(void**)& GdipFillEllipseI }, - { "GdipFillPie", cast(void**)& GdipFillPie }, - { "GdipFillPieI", cast(void**)& GdipFillPieI }, - { "GdipFillPath", cast(void**)& GdipFillPath }, - { "GdipFillClosedCurve", cast(void**)& GdipFillClosedCurve }, - { "GdipFillClosedCurveI", cast(void**)& GdipFillClosedCurveI }, - { "GdipFillClosedCurve2", cast(void**)& GdipFillClosedCurve2 }, - { "GdipFillClosedCurve2I", cast(void**)& GdipFillClosedCurve2I }, - { "GdipFillRegion", cast(void**)& GdipFillRegion }, - { "GdipDrawString", cast(void**)& GdipDrawString }, - { "GdipMeasureString", cast(void**)& GdipMeasureString }, - { "GdipGetStringFormatMeasurableCharacterRangeCount", cast(void**)& GdipGetStringFormatMeasurableCharacterRangeCount }, - { "GdipCloneStringFormat", cast(void**)& GdipCloneStringFormat }, - { "GdipMeasureCharacterRanges", cast(void**)& GdipMeasureCharacterRanges }, - { "GdipDrawImage", cast(void**)& GdipDrawImage }, - { "GdipDrawImageI", cast(void**)& GdipDrawImageI }, - { "GdipDrawImageRect", cast(void**)& GdipDrawImageRect }, - { "GdipDrawImageRectI", cast(void**)& GdipDrawImageRectI }, - { "GdipDrawImagePointRect", cast(void**)& GdipDrawImagePointRect }, - { "GdipDrawImagePointRectI", cast(void**)& GdipDrawImagePointRectI }, - { "GdipDrawImageRectRect", cast(void**)& GdipDrawImageRectRect }, - { "GdipDrawImageRectRectI", cast(void**)& GdipDrawImageRectRectI }, - { "GdipDrawImagePoints", cast(void**)& GdipDrawImagePoints }, - { "GdipDrawImagePointsI", cast(void**)& GdipDrawImagePointsI }, - { "GdipDrawImagePointsRect", cast(void**)& GdipDrawImagePointsRect }, - { "GdipDrawImagePointsRectI", cast(void**)& GdipDrawImagePointsRectI }, - { "GdipIsVisiblePoint", cast(void**)& GdipIsVisiblePoint }, - { "GdipIsVisiblePointI", cast(void**)& GdipIsVisiblePointI }, - { "GdipIsVisibleRect", cast(void**)& GdipIsVisibleRect }, - { "GdipIsVisibleRectI", cast(void**)& GdipIsVisibleRectI }, - { "GdipGetTextRenderingHint", cast(void**)& GdipGetTextRenderingHint }, - { "GdipSetTextRenderingHint", cast(void**)& GdipSetTextRenderingHint }, - { "GdipGetClipBounds", cast(void**)& GdipGetClipBounds }, - { "GdipGetClipBoundsI", cast(void**)& GdipGetClipBoundsI }, - { "GdipGetVisibleClipBounds", cast(void**)& GdipGetVisibleClipBounds }, - { "GdipGetVisibleClipBoundsI", cast(void**)& GdipGetVisibleClipBoundsI }, - { "GdipIsClipEmpty", cast(void**)& GdipIsClipEmpty }, - { "GdipIsVisibleClipEmpty", cast(void**)& GdipIsVisibleClipEmpty }, - { "GdipGetRenderingOrigin", cast(void**)& GdipGetRenderingOrigin }, - { "GdipSetRenderingOrigin", cast(void**)& GdipSetRenderingOrigin }, - { "GdipGetNearestColor", cast(void**)& GdipGetNearestColor }, - { "GdipComment", cast(void**)& GdipComment }, - { "GdipTransformPoints", cast(void**)& GdipTransformPoints }, - { "GdipTransformPointsI", cast(void**)& GdipTransformPointsI }, - { "GdipCreateMatrix", cast(void**)& GdipCreateMatrix }, - { "GdipCreateMatrix2", cast(void**)& GdipCreateMatrix2 }, - { "GdipCreateMatrix3", cast(void**)& GdipCreateMatrix3 }, - { "GdipCreateMatrix3I", cast(void**)& GdipCreateMatrix3I }, - { "GdipDeleteMatrix", cast(void**)& GdipDeleteMatrix }, - { "GdipCloneMatrix", cast(void**)& GdipCloneMatrix }, - { "GdipGetMatrixElements", cast(void**)& GdipGetMatrixElements }, - { "GdipSetMatrixElements", cast(void**)& GdipSetMatrixElements }, - { "GdipInvertMatrix", cast(void**)& GdipInvertMatrix }, - { "GdipMultiplyMatrix", cast(void**)& GdipMultiplyMatrix }, - { "GdipScaleMatrix", cast(void**)& GdipScaleMatrix }, - { "GdipShearMatrix", cast(void**)& GdipShearMatrix }, - { "GdipRotateMatrix", cast(void**)& GdipRotateMatrix }, - { "GdipTranslateMatrix", cast(void**)& GdipTranslateMatrix }, - { "GdipIsMatrixIdentity", cast(void**)& GdipIsMatrixIdentity }, - { "GdipIsMatrixInvertible", cast(void**)& GdipIsMatrixInvertible }, - { "GdipTransformMatrixPoints", cast(void**)& GdipTransformMatrixPoints }, - { "GdipGetBrushType", cast(void**)& GdipGetBrushType }, - { "GdipCloneBrush", cast(void**)& GdipCloneBrush }, - { "GdipDeleteBrush", cast(void**)& GdipDeleteBrush }, - { "GdipCreateSolidFill", cast(void**)& GdipCreateSolidFill }, - { "GdipGetSolidFillColor", cast(void**)& GdipGetSolidFillColor }, - { "GdipSetSolidFillColor", cast(void**)& GdipSetSolidFillColor }, - { "GdipCreateTexture", cast(void**)& GdipCreateTexture }, - { "GdipCreateTexture2", cast(void**)& GdipCreateTexture2 }, - { "GdipCreateTexture2I", cast(void**)& GdipCreateTexture2I }, - { "GdipGetTextureImage", cast(void**)& GdipGetTextureImage }, - { "GdipGetTextureTransform", cast(void**)& GdipGetTextureTransform }, - { "GdipSetTextureTransform", cast(void**)& GdipSetTextureTransform }, - { "GdipGetTextureWrapMode", cast(void**)& GdipGetTextureWrapMode }, - { "GdipSetTextureWrapMode", cast(void**)& GdipSetTextureWrapMode }, - { "GdipCreateHatchBrush", cast(void**)& GdipCreateHatchBrush }, - { "GdipGetHatchStyle", cast(void**)& GdipGetHatchStyle }, - { "GdipGetHatchForegroundColor", cast(void**)& GdipGetHatchForegroundColor }, - { "GdipGetHatchBackgroundColor", cast(void**)& GdipGetHatchBackgroundColor }, - { "GdipCreateLineBrushI", cast(void**)& GdipCreateLineBrushI }, - { "GdipCreateLineBrush", cast(void**)& GdipCreateLineBrush }, - { "GdipCreateLineBrushFromRectI", cast(void**)& GdipCreateLineBrushFromRectI }, - { "GdipCreateLineBrushFromRect", cast(void**)& GdipCreateLineBrushFromRect }, - { "GdipCreateLineBrushFromRectWithAngleI", cast(void**)& GdipCreateLineBrushFromRectWithAngleI }, - { "GdipCreateLineBrushFromRectWithAngle", cast(void**)& GdipCreateLineBrushFromRectWithAngle }, - { "GdipGetLineBlendCount", cast(void**)& GdipGetLineBlendCount }, - { "GdipGetLineBlend", cast(void**)& GdipGetLineBlend }, - { "GdipSetLineBlend", cast(void**)& GdipSetLineBlend }, - { "GdipGetLinePresetBlendCount", cast(void**)& GdipGetLinePresetBlendCount }, - { "GdipGetLinePresetBlend", cast(void**)& GdipGetLinePresetBlend }, - { "GdipSetLinePresetBlend", cast(void**)& GdipSetLinePresetBlend }, - { "GdipGetLineWrapMode", cast(void**)& GdipGetLineWrapMode }, - { "GdipSetLineWrapMode", cast(void**)& GdipSetLineWrapMode }, - { "GdipGetLineRect", cast(void**)& GdipGetLineRect }, - { "GdipGetLineColors", cast(void**)& GdipGetLineColors }, - { "GdipSetLineColors", cast(void**)& GdipSetLineColors }, - { "GdipGetLineGammaCorrection", cast(void**)& GdipGetLineGammaCorrection }, - { "GdipSetLineGammaCorrection", cast(void**)& GdipSetLineGammaCorrection }, - { "GdipSetLineSigmaBlend", cast(void**)& GdipSetLineSigmaBlend }, - { "GdipSetLineLinearBlend", cast(void**)& GdipSetLineLinearBlend }, - { "GdipGetLineTransform", cast(void**)& GdipGetLineTransform }, - { "GdipSetLineTransform", cast(void**)& GdipSetLineTransform }, - { "GdipResetLineTransform", cast(void**)& GdipResetLineTransform }, - { "GdipMultiplyLineTransform", cast(void**)& GdipMultiplyLineTransform }, - { "GdipTranslateLineTransform", cast(void**)& GdipTranslateLineTransform }, - { "GdipScaleLineTransform", cast(void**)& GdipScaleLineTransform }, - { "GdipRotateLineTransform", cast(void**)& GdipRotateLineTransform }, - { "GdipCreatePen1", cast(void**)& GdipCreatePen1 }, - { "GdipCreatePen2", cast(void**)& GdipCreatePen2 }, - { "GdipDeletePen", cast(void**)& GdipDeletePen }, - { "GdipClonePen", cast(void**)& GdipClonePen }, - { "GdipSetPenLineCap197819", cast(void**)& GdipSetPenLineCap197819 }, - { "GdipGetPenStartCap", cast(void**)& GdipGetPenStartCap }, - { "GdipSetPenStartCap", cast(void**)& GdipSetPenStartCap }, - { "GdipGetPenEndCap", cast(void**)& GdipGetPenEndCap }, - { "GdipSetPenEndCap", cast(void**)& GdipSetPenEndCap }, - { "GdipGetPenDashCap197819", cast(void**)& GdipGetPenDashCap197819 }, - { "GdipSetPenDashCap197819", cast(void**)& GdipSetPenDashCap197819 }, - { "GdipGetPenLineJoin", cast(void**)& GdipGetPenLineJoin }, - { "GdipSetPenLineJoin", cast(void**)& GdipSetPenLineJoin }, - { "GdipGetPenMiterLimit", cast(void**)& GdipGetPenMiterLimit }, - { "GdipSetPenMiterLimit", cast(void**)& GdipSetPenMiterLimit }, - { "GdipGetPenMode", cast(void**)& GdipGetPenMode }, - { "GdipSetPenMode", cast(void**)& GdipSetPenMode }, - { "GdipGetPenTransform", cast(void**)& GdipGetPenTransform }, - { "GdipSetPenTransform", cast(void**)& GdipSetPenTransform }, - { "GdipResetPenTransform", cast(void**)& GdipResetPenTransform }, - { "GdipMultiplyPenTransform", cast(void**)& GdipMultiplyPenTransform }, - { "GdipTranslatePenTransform", cast(void**)& GdipTranslatePenTransform }, - { "GdipScalePenTransform", cast(void**)& GdipScalePenTransform }, - { "GdipRotatePenTransform", cast(void**)& GdipRotatePenTransform }, - { "GdipGetPenColor", cast(void**)& GdipGetPenColor }, - { "GdipSetPenColor", cast(void**)& GdipSetPenColor }, - { "GdipGetPenWidth", cast(void**)& GdipGetPenWidth }, - { "GdipSetPenWidth", cast(void**)& GdipSetPenWidth }, - { "GdipGetPenFillType", cast(void**)& GdipGetPenFillType }, - { "GdipGetPenBrushFill", cast(void**)& GdipGetPenBrushFill }, - { "GdipSetPenBrushFill", cast(void**)& GdipSetPenBrushFill }, - { "GdipGetPenDashStyle", cast(void**)& GdipGetPenDashStyle }, - { "GdipSetPenDashStyle", cast(void**)& GdipSetPenDashStyle }, - { "GdipGetPenDashOffset", cast(void**)& GdipGetPenDashOffset }, - { "GdipSetPenDashOffset", cast(void**)& GdipSetPenDashOffset }, - { "GdipGetPenDashCount", cast(void**)& GdipGetPenDashCount }, - { "GdipGetPenDashArray", cast(void**)& GdipGetPenDashArray }, - { "GdipSetPenDashArray", cast(void**)& GdipSetPenDashArray }, - { "GdipGetPenCompoundCount", cast(void**)& GdipGetPenCompoundCount }, - { "GdipGetPenCompoundArray", cast(void**)& GdipGetPenCompoundArray }, - { "GdipSetPenCompoundArray", cast(void**)& GdipSetPenCompoundArray }, - { "GdipCreateRegion", cast(void**)& GdipCreateRegion }, - { "GdipCreateRegionRect", cast(void**)& GdipCreateRegionRect }, - { "GdipCreateRegionRectI", cast(void**)& GdipCreateRegionRectI }, - { "GdipCreateRegionPath", cast(void**)& GdipCreateRegionPath }, - { "GdipCreateRegionHrgn", cast(void**)& GdipCreateRegionHrgn }, - { "GdipDeleteRegion", cast(void**)& GdipDeleteRegion }, - { "GdipSetInfinite", cast(void**)& GdipSetInfinite }, - { "GdipSetEmpty", cast(void**)& GdipSetEmpty }, - { "GdipCombineRegionRect", cast(void**)& GdipCombineRegionRect }, - { "GdipCombineRegionRectI", cast(void**)& GdipCombineRegionRectI }, - { "GdipCombineRegionPath", cast(void**)& GdipCombineRegionPath }, - { "GdipCombineRegionRegion", cast(void**)& GdipCombineRegionRegion }, - { "GdipTranslateRegion", cast(void**)& GdipTranslateRegion }, - { "GdipTranslateRegionI", cast(void**)& GdipTranslateRegionI }, - { "GdipTransformRegion", cast(void**)& GdipTransformRegion }, - { "GdipGetRegionBounds", cast(void**)& GdipGetRegionBounds }, - { "GdipGetRegionHRgn", cast(void**)& GdipGetRegionHRgn }, - { "GdipIsEmptyRegion", cast(void**)& GdipIsEmptyRegion }, - { "GdipIsInfiniteRegion", cast(void**)& GdipIsInfiniteRegion }, - { "GdipIsEqualRegion", cast(void**)& GdipIsEqualRegion }, - { "GdipIsVisibleRegionPoint", cast(void**)& GdipIsVisibleRegionPoint }, - { "GdipIsVisibleRegionRect", cast(void**)& GdipIsVisibleRegionRect }, - { "GdipIsVisibleRegionPointI", cast(void**)& GdipIsVisibleRegionPointI }, - { "GdipIsVisibleRegionRectI", cast(void**)& GdipIsVisibleRegionRectI }, - { "GdipGetRegionScansCount", cast(void**)& GdipGetRegionScansCount }, - { "GdipGetRegionScans", cast(void**)& GdipGetRegionScans }, - { "GdipDisposeImage", cast(void**)& GdipDisposeImage }, - { "GdipImageForceValidation", cast(void**)& GdipImageForceValidation }, - { "GdipLoadImageFromFileICM", cast(void**)& GdipLoadImageFromFileICM }, - { "GdipLoadImageFromFile", cast(void**)& GdipLoadImageFromFile }, - { "GdipGetImageEncodersSize", cast(void**)& GdipGetImageEncodersSize }, - { "GdipCloneImage", cast(void**)& GdipCloneImage }, - { "GdipGetImageType", cast(void**)& GdipGetImageType }, - { "GdipGetImageFlags", cast(void**)& GdipGetImageFlags }, - { "GdipGetImageWidth", cast(void**)& GdipGetImageWidth }, - { "GdipGetImageHeight", cast(void**)& GdipGetImageHeight }, - { "GdipGetImageHorizontalResolution", cast(void**)& GdipGetImageHorizontalResolution }, - { "GdipGetImageVerticalResolution", cast(void**)& GdipGetImageVerticalResolution }, - { "GdipGetPropertyCount", cast(void**)& GdipGetPropertyCount }, - { "GdipGetPropertyIdList", cast(void**)& GdipGetPropertyIdList }, - { "GdipGetImagePixelFormat", cast(void**)& GdipGetImagePixelFormat }, - { "GdipGetImageDimension", cast(void**)& GdipGetImageDimension }, - { "GdipGetImageThumbnail", cast(void**)& GdipGetImageThumbnail }, - { "GdipImageGetFrameDimensionsCount", cast(void**)& GdipImageGetFrameDimensionsCount }, - { "GdipImageRotateFlip", cast(void**)& GdipImageRotateFlip }, - { "GdipGetPropertyItemSize", cast(void**)& GdipGetPropertyItemSize }, - { "GdipGetPropertyItem", cast(void**)& GdipGetPropertyItem }, - { "GdipSetPropertyItem", cast(void**)& GdipSetPropertyItem }, - { "GdipRemovePropertyItem", cast(void**)& GdipRemovePropertyItem }, - { "GdipGetPropertySize", cast(void**)& GdipGetPropertySize }, - { "GdipGetAllPropertyItems", cast(void**)& GdipGetAllPropertyItems }, - { "GdipGetImageBounds", cast(void**)& GdipGetImageBounds }, - { "GdipGetImagePaletteSize", cast(void**)& GdipGetImagePaletteSize }, - { "GdipGetImagePalette", cast(void**)& GdipGetImagePalette }, - { "GdipSetImagePalette", cast(void**)& GdipSetImagePalette }, - { "GdipCreateBitmapFromScan0", cast(void**)& GdipCreateBitmapFromScan0 }, - { "GdipCreateBitmapFromHBITMAP", cast(void**)& GdipCreateBitmapFromHBITMAP }, - { "GdipCreateBitmapFromHICON", cast(void**)& GdipCreateBitmapFromHICON }, - { "GdipCreateBitmapFromFileICM", cast(void**)& GdipCreateBitmapFromFileICM }, - { "GdipCreateBitmapFromFile", cast(void**)& GdipCreateBitmapFromFile }, - { "GdipCreateBitmapFromGraphics", cast(void**)& GdipCreateBitmapFromGraphics }, - { "GdipCloneBitmapArea", cast(void**)& GdipCloneBitmapArea }, - { "GdipCloneBitmapAreaI", cast(void**)& GdipCloneBitmapAreaI }, - { "GdipBitmapGetPixel", cast(void**)& GdipBitmapGetPixel }, - { "GdipBitmapSetPixel", cast(void**)& GdipBitmapSetPixel }, - { "GdipBitmapLockBits", cast(void**)& GdipBitmapLockBits }, - { "GdipBitmapUnlockBits", cast(void**)& GdipBitmapUnlockBits }, - { "GdipBitmapSetResolution", cast(void**)& GdipBitmapSetResolution }, - { "GdipCreateHICONFromBitmap", cast(void**)& GdipCreateHICONFromBitmap }, - { "GdipCreateHBITMAPFromBitmap", cast(void**)& GdipCreateHBITMAPFromBitmap }, - { "GdipCreateImageAttributes", cast(void**)& GdipCreateImageAttributes }, - { "GdipDisposeImageAttributes", cast(void**)& GdipDisposeImageAttributes }, - { "GdipSetImageAttributesColorMatrix", cast(void**)& GdipSetImageAttributesColorMatrix }, - { "GdipSetImageAttributesThreshold", cast(void**)& GdipSetImageAttributesThreshold }, - { "GdipSetImageAttributesGamma", cast(void**)& GdipSetImageAttributesGamma }, - { "GdipSetImageAttributesNoOp", cast(void**)& GdipSetImageAttributesNoOp }, - { "GdipSetImageAttributesColorKeys", cast(void**)& GdipSetImageAttributesColorKeys }, - { "GdipSetImageAttributesOutputChannel", cast(void**)& GdipSetImageAttributesOutputChannel }, - { "GdipSetImageAttributesOutputChannelColorProfile", cast(void**)& GdipSetImageAttributesOutputChannelColorProfile }, - { "GdipSetImageAttributesWrapMode", cast(void**)& GdipSetImageAttributesWrapMode }, - { "GdipNewInstalledFontCollection", cast(void**)& GdipNewInstalledFontCollection }, - { "GdipNewPrivateFontCollection", cast(void**)& GdipNewPrivateFontCollection }, - { "GdipDeletePrivateFontCollection", cast(void**)& GdipDeletePrivateFontCollection }, - { "GdipPrivateAddFontFile", cast(void**)& GdipPrivateAddFontFile }, - { "GdipPrivateAddMemoryFont", cast(void**)& GdipPrivateAddMemoryFont }, - { "GdipGetFontCollectionFamilyCount", cast(void**)& GdipGetFontCollectionFamilyCount }, - { "GdipGetFontCollectionFamilyList", cast(void**)& GdipGetFontCollectionFamilyList }, - { "GdipCreateFontFamilyFromName", cast(void**)& GdipCreateFontFamilyFromName }, - { "GdipDeleteFontFamily", cast(void**)& GdipDeleteFontFamily }, - { "GdipCloneFontFamily", cast(void**)& GdipCloneFontFamily }, - { "GdipGetFamilyName", cast(void**)& GdipGetFamilyName }, - { "GdipGetGenericFontFamilyMonospace", cast(void**)& GdipGetGenericFontFamilyMonospace }, - { "GdipGetGenericFontFamilySerif", cast(void**)& GdipGetGenericFontFamilySerif }, - { "GdipGetGenericFontFamilySansSerif", cast(void**)& GdipGetGenericFontFamilySansSerif }, - { "GdipGetEmHeight", cast(void**)& GdipGetEmHeight }, - { "GdipGetCellAscent", cast(void**)& GdipGetCellAscent }, - { "GdipGetCellDescent", cast(void**)& GdipGetCellDescent }, - { "GdipGetLineSpacing", cast(void**)& GdipGetLineSpacing }, - { "GdipIsStyleAvailable", cast(void**)& GdipIsStyleAvailable }, - { "GdipCreateFont", cast(void**)& GdipCreateFont }, - { "GdipCreateFontFromDC", cast(void**)& GdipCreateFontFromDC }, - { "GdipDeleteFont", cast(void**)& GdipDeleteFont }, - { "GdipCloneFont", cast(void**)& GdipCloneFont }, - { "GdipGetFontSize", cast(void**)& GdipGetFontSize }, - { "GdipGetFontHeight", cast(void**)& GdipGetFontHeight }, - { "GdipGetFontHeightGivenDPI", cast(void**)& GdipGetFontHeightGivenDPI }, - { "GdipGetFontStyle", cast(void**)& GdipGetFontStyle }, - { "GdipGetFontUnit", cast(void**)& GdipGetFontUnit }, - { "GdipGetFamily", cast(void**)& GdipGetFamily }, - { "GdipCreateFontFromLogfontW", cast(void**)& GdipCreateFontFromLogfontW }, - { "GdipCreateFontFromLogfontA", cast(void**)& GdipCreateFontFromLogfontA }, - { "GdipGetLogFontW", cast(void**)& GdipGetLogFontW }, - { "GdipCreateStringFormat", cast(void**)& GdipCreateStringFormat }, - { "GdipDeleteStringFormat", cast(void**)& GdipDeleteStringFormat }, - { "GdipGetStringFormatFlags", cast(void**)& GdipGetStringFormatFlags }, - { "GdipSetStringFormatFlags", cast(void**)& GdipSetStringFormatFlags }, - { "GdipGetStringFormatAlign", cast(void**)& GdipGetStringFormatAlign }, - { "GdipSetStringFormatAlign", cast(void**)& GdipSetStringFormatAlign }, - { "GdipGetStringFormatLineAlign", cast(void**)& GdipGetStringFormatLineAlign }, - { "GdipSetStringFormatLineAlign", cast(void**)& GdipSetStringFormatLineAlign }, - { "GdipGetStringFormatTrimming", cast(void**)& GdipGetStringFormatTrimming }, - { "GdipSetStringFormatTrimming", cast(void**)& GdipSetStringFormatTrimming }, - { "GdipCreatePath", cast(void**)& GdipCreatePath }, - { "GdipCreatePath2", cast(void**)& GdipCreatePath2 }, - { "GdipCreatePath2I", cast(void**)& GdipCreatePath2I }, - { "GdipDeletePath", cast(void**)& GdipDeletePath }, - { "GdipClonePath", cast(void**)& GdipClonePath }, - { "GdipResetPath", cast(void**)& GdipResetPath }, - { "GdipGetPathFillMode", cast(void**)& GdipGetPathFillMode }, - { "GdipSetPathFillMode", cast(void**)& GdipSetPathFillMode }, - { "GdipStartPathFigure", cast(void**)& GdipStartPathFigure }, - { "GdipClosePathFigure", cast(void**)& GdipClosePathFigure }, - { "GdipClosePathFigures", cast(void**)& GdipClosePathFigures }, - { "GdipSetPathMarker", cast(void**)& GdipSetPathMarker }, - { "GdipClearPathMarkers", cast(void**)& GdipClearPathMarkers }, - { "GdipReversePath", cast(void**)& GdipReversePath }, - { "GdipGetPathLastPoint", cast(void**)& GdipGetPathLastPoint }, - { "GdipAddPathLine", cast(void**)& GdipAddPathLine }, - { "GdipAddPathLineI", cast(void**)& GdipAddPathLineI }, - { "GdipAddPathLine2", cast(void**)& GdipAddPathLine2 }, - { "GdipAddPathLine2I", cast(void**)& GdipAddPathLine2I }, - { "GdipAddPathArc", cast(void**)& GdipAddPathArc }, - { "GdipAddPathArcI", cast(void**)& GdipAddPathArcI }, - { "GdipAddPathBezier", cast(void**)& GdipAddPathBezier }, - { "GdipAddPathBezierI", cast(void**)& GdipAddPathBezierI }, - { "GdipAddPathBeziers", cast(void**)& GdipAddPathBeziers }, - { "GdipAddPathBeziersI", cast(void**)& GdipAddPathBeziersI }, - { "GdipAddPathCurve", cast(void**)& GdipAddPathCurve }, - { "GdipAddPathCurveI", cast(void**)& GdipAddPathCurveI }, - { "GdipAddPathCurve2", cast(void**)& GdipAddPathCurve2 }, - { "GdipAddPathCurve2I", cast(void**)& GdipAddPathCurve2I }, - { "GdipAddPathCurve3", cast(void**)& GdipAddPathCurve3 }, - { "GdipAddPathCurve3I", cast(void**)& GdipAddPathCurve3I }, - { "GdipAddPathClosedCurve", cast(void**)& GdipAddPathClosedCurve }, - { "GdipAddPathClosedCurveI", cast(void**)& GdipAddPathClosedCurveI }, - { "GdipAddPathClosedCurve2", cast(void**)& GdipAddPathClosedCurve2 }, - { "GdipAddPathClosedCurve2I", cast(void**)& GdipAddPathClosedCurve2I }, - { "GdipAddPathRectangle", cast(void**)& GdipAddPathRectangle }, - { "GdipAddPathRectangleI", cast(void**)& GdipAddPathRectangleI }, - { "GdipAddPathRectangles", cast(void**)& GdipAddPathRectangles }, - { "GdipAddPathRectanglesI", cast(void**)& GdipAddPathRectanglesI }, - { "GdipAddPathEllipse", cast(void**)& GdipAddPathEllipse }, - { "GdipAddPathEllipseI", cast(void**)& GdipAddPathEllipseI }, - { "GdipAddPathPie", cast(void**)& GdipAddPathPie }, - { "GdipAddPathPieI", cast(void**)& GdipAddPathPieI }, - { "GdipAddPathPolygon", cast(void**)& GdipAddPathPolygon }, - { "GdipAddPathPolygonI", cast(void**)& GdipAddPathPolygonI }, - { "GdipAddPathPath", cast(void**)& GdipAddPathPath }, - { "GdipAddPathString", cast(void**)& GdipAddPathString }, - { "GdipAddPathStringI", cast(void**)& GdipAddPathStringI }, - { "GdipTransformPath", cast(void**)& GdipTransformPath }, - { "GdipGetPathWorldBounds", cast(void**)& GdipGetPathWorldBounds }, - { "GdipFlattenPath", cast(void**)& GdipFlattenPath }, - { "GdipWidenPath", cast(void**)& GdipWidenPath }, - { "GdipWindingModeOutline", cast(void**)& GdipWindingModeOutline }, - { "GdipWarpPath", cast(void**)& GdipWarpPath }, - { "GdipGetPointCount", cast(void**)& GdipGetPointCount }, - { "GdipGetPathTypes", cast(void**)& GdipGetPathTypes }, - { "GdipGetPathPoints", cast(void**)& GdipGetPathPoints }, - { "GdipIsVisiblePathPoint", cast(void**)& GdipIsVisiblePathPoint }, - { "GdipIsVisiblePathPointI", cast(void**)& GdipIsVisiblePathPointI }, - { "GdipIsOutlineVisiblePathPoint", cast(void**)& GdipIsOutlineVisiblePathPoint }, - { "GdipIsOutlineVisiblePathPointI", cast(void**)& GdipIsOutlineVisiblePathPointI }, - { "GdipDrawPath", cast(void**)& GdipDrawPath }, - { "GdipCreatePathIter", cast(void**)& GdipCreatePathIter }, - { "GdipDeletePathIter", cast(void**)& GdipDeletePathIter }, - { "GdipPathIterNextSubpath", cast(void**)& GdipPathIterNextSubpath }, - { "GdipPathIterNextSubpathPath", cast(void**)& GdipPathIterNextSubpathPath }, - { "GdipPathIterNextPathType", cast(void**)& GdipPathIterNextPathType }, - { "GdipPathIterNextMarker", cast(void**)& GdipPathIterNextMarker }, - { "GdipPathIterNextMarkerPath", cast(void**)& GdipPathIterNextMarkerPath }, - { "GdipPathIterGetCount", cast(void**)& GdipPathIterGetCount }, - { "GdipPathIterGetSubpathCount", cast(void**)& GdipPathIterGetSubpathCount }, - { "GdipPathIterHasCurve", cast(void**)& GdipPathIterHasCurve }, - { "GdipPathIterRewind", cast(void**)& GdipPathIterRewind }, - { "GdipPathIterEnumerate", cast(void**)& GdipPathIterEnumerate }, - { "GdipPathIterCopyData", cast(void**)& GdipPathIterCopyData }, - { "GdipCreatePathGradient", cast(void**)& GdipCreatePathGradient }, - { "GdipCreatePathGradientI", cast(void**)& GdipCreatePathGradientI }, - { "GdipCreatePathGradientFromPath", cast(void**)& GdipCreatePathGradientFromPath }, - { "GdipGetPathGradientCenterColor", cast(void**)& GdipGetPathGradientCenterColor }, - { "GdipSetPathGradientCenterColor", cast(void**)& GdipSetPathGradientCenterColor }, - { "GdipGetPathGradientSurroundColorCount", cast(void**)& GdipGetPathGradientSurroundColorCount }, - { "GdipGetPathGradientSurroundColorsWithCount", cast(void**)& GdipGetPathGradientSurroundColorsWithCount }, - { "GdipSetPathGradientSurroundColorsWithCount", cast(void**)& GdipSetPathGradientSurroundColorsWithCount }, - { "GdipGetPathGradientCenterPoint", cast(void**)& GdipGetPathGradientCenterPoint }, - { "GdipSetPathGradientCenterPoint", cast(void**)& GdipSetPathGradientCenterPoint }, - { "GdipGetPathGradientRect", cast(void**)& GdipGetPathGradientRect }, - { "GdipGetPathGradientBlendCount", cast(void**)& GdipGetPathGradientBlendCount }, - { "GdipGetPathGradientBlend", cast(void**)& GdipGetPathGradientBlend }, - { "GdipSetPathGradientBlend", cast(void**)& GdipSetPathGradientBlend }, - { "GdipGetPathGradientPresetBlendCount", cast(void**)& GdipGetPathGradientPresetBlendCount }, - { "GdipGetPathGradientPresetBlend", cast(void**)& GdipGetPathGradientPresetBlend }, - { "GdipSetPathGradientPresetBlend", cast(void**)& GdipSetPathGradientPresetBlend }, - { "GdipSetPathGradientSigmaBlend", cast(void**)& GdipSetPathGradientSigmaBlend }, - { "GdipSetPathGradientLinearBlend", cast(void**)& GdipSetPathGradientLinearBlend }, - { "GdipGetPathGradientTransform", cast(void**)& GdipGetPathGradientTransform }, - { "GdipSetPathGradientTransform", cast(void**)& GdipSetPathGradientTransform }, - { "GdipResetPathGradientTransform", cast(void**)& GdipResetPathGradientTransform }, - { "GdipMultiplyPathGradientTransform", cast(void**)& GdipMultiplyPathGradientTransform }, - { "GdipRotatePathGradientTransform", cast(void**)& GdipRotatePathGradientTransform }, - { "GdipTranslatePathGradientTransform", cast(void**)& GdipTranslatePathGradientTransform }, - { "GdipScalePathGradientTransform", cast(void**)& GdipScalePathGradientTransform }, - { "GdipGetPathGradientFocusScales", cast(void**)& GdipGetPathGradientFocusScales }, - { "GdipSetPathGradientFocusScales", cast(void**)& GdipSetPathGradientFocusScales }, - { "GdipGetPathGradientWrapMode", cast(void**)& GdipGetPathGradientWrapMode }, - { "GdipSetPathGradientWrapMode", cast(void**)& GdipSetPathGradientWrapMode }, - { "GdipResetTextureTransform", cast(void**)& GdipResetTextureTransform }, - { "GdipScaleTextureTransform", cast(void**)& GdipScaleTextureTransform }, - { "GdipTranslateTextureTransform", cast(void**)& GdipTranslateTextureTransform }, - { "GdipStringFormatGetGenericDefault", cast(void**)& GdipStringFormatGetGenericDefault }, - { "GdipStringFormatGetGenericTypographic", cast(void**)& GdipStringFormatGetGenericTypographic }, - { "GdipSetStringFormatHotkeyPrefix", cast(void**)& GdipSetStringFormatHotkeyPrefix }, - { "GdipSetStringFormatTabStops", cast(void**)& GdipSetStringFormatTabStops }, -]; +Symbol[] symbols; +static this(){ + symbols = [ + Symbol( "GdiplusStartup", cast(void**)& GdiplusStartup ), + Symbol( "GdiplusShutdown", cast(void**)& GdiplusShutdown ), + Symbol( "GdipCreateFromHDC", cast(void**)& GdipCreateFromHDC ), + Symbol( "GdipCreateFromHDC2", cast(void**)& GdipCreateFromHDC2 ), + Symbol( "GdipCreateFromHWND", cast(void**)& GdipCreateFromHWND ), + Symbol( "GdipGetImageGraphicsContext", cast(void**)& GdipGetImageGraphicsContext ), + Symbol( "GdipDeleteGraphics", cast(void**)& GdipDeleteGraphics ), + Symbol( "GdipGetDC", cast(void**)& GdipGetDC ), + Symbol( "GdipReleaseDC", cast(void**)& GdipReleaseDC ), + Symbol( "GdipSetClipGraphics", cast(void**)& GdipSetClipGraphics ), + Symbol( "GdipSetClipRectI", cast(void**)& GdipSetClipRectI ), + Symbol( "GdipSetClipRect", cast(void**)& GdipSetClipRect ), + Symbol( "GdipSetClipPath", cast(void**)& GdipSetClipPath ), + Symbol( "GdipSetClipRegion", cast(void**)& GdipSetClipRegion ), + Symbol( "GdipSetClipHrgn", cast(void**)& GdipSetClipHrgn ), + Symbol( "GdipGetClip", cast(void**)& GdipGetClip ), + Symbol( "GdipResetClip", cast(void**)& GdipResetClip ), + Symbol( "GdipSaveGraphics", cast(void**)& GdipSaveGraphics ), + Symbol( "GdipRestoreGraphics", cast(void**)& GdipRestoreGraphics ), + Symbol( "GdipFlush", cast(void**)& GdipFlush ), + Symbol( "GdipScaleWorldTransform", cast(void**)& GdipScaleWorldTransform ), + Symbol( "GdipRotateWorldTransform", cast(void**)& GdipRotateWorldTransform ), + Symbol( "GdipTranslateWorldTransform", cast(void**)& GdipTranslateWorldTransform ), + Symbol( "GdipMultiplyWorldTransform", cast(void**)& GdipMultiplyWorldTransform ), + Symbol( "GdipResetWorldTransform", cast(void**)& GdipResetWorldTransform ), + Symbol( "GdipBeginContainer", cast(void**)& GdipBeginContainer ), + Symbol( "GdipBeginContainerI", cast(void**)& GdipBeginContainerI ), + Symbol( "GdipBeginContainer2", cast(void**)& GdipBeginContainer2 ), + Symbol( "GdipEndContainer", cast(void**)& GdipEndContainer ), + Symbol( "GdipGetDpiX", cast(void**)& GdipGetDpiX ), + Symbol( "GdipGetDpiY", cast(void**)& GdipGetDpiY ), + Symbol( "GdipGetPageUnit", cast(void**)& GdipGetPageUnit ), + Symbol( "GdipSetPageUnit", cast(void**)& GdipSetPageUnit ), + Symbol( "GdipGetPageScale", cast(void**)& GdipGetPageScale ), + Symbol( "GdipSetPageScale", cast(void**)& GdipSetPageScale ), + Symbol( "GdipGetWorldTransform", cast(void**)& GdipGetWorldTransform ), + Symbol( "GdipSetWorldTransform", cast(void**)& GdipSetWorldTransform ), + Symbol( "GdipGetCompositingMode", cast(void**)& GdipGetCompositingMode ), + Symbol( "GdipSetCompositingMode", cast(void**)& GdipSetCompositingMode ), + Symbol( "GdipGetCompositingQuality", cast(void**)& GdipGetCompositingQuality ), + Symbol( "GdipSetCompositingQuality", cast(void**)& GdipSetCompositingQuality ), + Symbol( "GdipGetInterpolationMode", cast(void**)& GdipGetInterpolationMode ), + Symbol( "GdipSetInterpolationMode", cast(void**)& GdipSetInterpolationMode ), + Symbol( "GdipGetSmoothingMode", cast(void**)& GdipGetSmoothingMode ), + Symbol( "GdipSetSmoothingMode", cast(void**)& GdipSetSmoothingMode ), + Symbol( "GdipGetPixelOffsetMode", cast(void**)& GdipGetPixelOffsetMode ), + Symbol( "GdipSetPixelOffsetMode", cast(void**)& GdipSetPixelOffsetMode ), + Symbol( "GdipGetTextContrast", cast(void**)& GdipGetTextContrast ), + Symbol( "GdipSetTextContrast", cast(void**)& GdipSetTextContrast ), + Symbol( "GdipGraphicsClear", cast(void**)& GdipGraphicsClear ), + Symbol( "GdipDrawLine", cast(void**)& GdipDrawLine ), + Symbol( "GdipDrawLines", cast(void**)& GdipDrawLines ), + Symbol( "GdipDrawLineI", cast(void**)& GdipDrawLineI ), + Symbol( "GdipDrawLinesI", cast(void**)& GdipDrawLinesI ), + Symbol( "GdipDrawArc", cast(void**)& GdipDrawArc ), + Symbol( "GdipDrawArcI", cast(void**)& GdipDrawArcI ), + Symbol( "GdipDrawBezier", cast(void**)& GdipDrawBezier ), + Symbol( "GdipDrawBeziers", cast(void**)& GdipDrawBeziers ), + Symbol( "GdipDrawBezierI", cast(void**)& GdipDrawBezierI ), + Symbol( "GdipDrawBeziersI", cast(void**)& GdipDrawBeziersI ), + Symbol( "GdipDrawRectangle", cast(void**)& GdipDrawRectangle ), + Symbol( "GdipDrawRectangles", cast(void**)& GdipDrawRectangles ), + Symbol( "GdipDrawRectangleI", cast(void**)& GdipDrawRectangleI ), + Symbol( "GdipDrawRectanglesI", cast(void**)& GdipDrawRectanglesI ), + Symbol( "GdipDrawEllipse", cast(void**)& GdipDrawEllipse ), + Symbol( "GdipDrawEllipseI", cast(void**)& GdipDrawEllipseI ), + Symbol( "GdipDrawPie", cast(void**)& GdipDrawPie ), + Symbol( "GdipDrawPieI", cast(void**)& GdipDrawPieI ), + Symbol( "GdipDrawPolygon", cast(void**)& GdipDrawPolygon ), + Symbol( "GdipDrawPolygonI", cast(void**)& GdipDrawPolygonI ), + Symbol( "GdipDrawCurve", cast(void**)& GdipDrawCurve ), + Symbol( "GdipDrawCurve2", cast(void**)& GdipDrawCurve2 ), + Symbol( "GdipDrawCurve3", cast(void**)& GdipDrawCurve3 ), + Symbol( "GdipDrawCurveI", cast(void**)& GdipDrawCurveI ), + Symbol( "GdipDrawCurve2I", cast(void**)& GdipDrawCurve2I ), + Symbol( "GdipDrawCurve3I", cast(void**)& GdipDrawCurve3I ), + Symbol( "GdipDrawClosedCurve", cast(void**)& GdipDrawClosedCurve ), + Symbol( "GdipDrawClosedCurve2", cast(void**)& GdipDrawClosedCurve2 ), + Symbol( "GdipDrawClosedCurveI", cast(void**)& GdipDrawClosedCurveI ), + Symbol( "GdipDrawClosedCurve2I", cast(void**)& GdipDrawClosedCurve2I ), + Symbol( "GdipFillRectangleI", cast(void**)& GdipFillRectangleI ), + Symbol( "GdipFillRectangle", cast(void**)& GdipFillRectangle ), + Symbol( "GdipFillRectanglesI", cast(void**)& GdipFillRectanglesI ), + Symbol( "GdipFillRectangles", cast(void**)& GdipFillRectangles ), + Symbol( "GdipFillPolygon", cast(void**)& GdipFillPolygon ), + Symbol( "GdipFillPolygonI", cast(void**)& GdipFillPolygonI ), + Symbol( "GdipFillEllipse", cast(void**)& GdipFillEllipse ), + Symbol( "GdipFillEllipseI", cast(void**)& GdipFillEllipseI ), + Symbol( "GdipFillPie", cast(void**)& GdipFillPie ), + Symbol( "GdipFillPieI", cast(void**)& GdipFillPieI ), + Symbol( "GdipFillPath", cast(void**)& GdipFillPath ), + Symbol( "GdipFillClosedCurve", cast(void**)& GdipFillClosedCurve ), + Symbol( "GdipFillClosedCurveI", cast(void**)& GdipFillClosedCurveI ), + Symbol( "GdipFillClosedCurve2", cast(void**)& GdipFillClosedCurve2 ), + Symbol( "GdipFillClosedCurve2I", cast(void**)& GdipFillClosedCurve2I ), + Symbol( "GdipFillRegion", cast(void**)& GdipFillRegion ), + Symbol( "GdipDrawString", cast(void**)& GdipDrawString ), + Symbol( "GdipMeasureString", cast(void**)& GdipMeasureString ), + Symbol( "GdipGetStringFormatMeasurableCharacterRangeCount", cast(void**)& GdipGetStringFormatMeasurableCharacterRangeCount ), + Symbol( "GdipCloneStringFormat", cast(void**)& GdipCloneStringFormat ), + Symbol( "GdipMeasureCharacterRanges", cast(void**)& GdipMeasureCharacterRanges ), + Symbol( "GdipDrawImage", cast(void**)& GdipDrawImage ), + Symbol( "GdipDrawImageI", cast(void**)& GdipDrawImageI ), + Symbol( "GdipDrawImageRect", cast(void**)& GdipDrawImageRect ), + Symbol( "GdipDrawImageRectI", cast(void**)& GdipDrawImageRectI ), + Symbol( "GdipDrawImagePointRect", cast(void**)& GdipDrawImagePointRect ), + Symbol( "GdipDrawImagePointRectI", cast(void**)& GdipDrawImagePointRectI ), + Symbol( "GdipDrawImageRectRect", cast(void**)& GdipDrawImageRectRect ), + Symbol( "GdipDrawImageRectRectI", cast(void**)& GdipDrawImageRectRectI ), + Symbol( "GdipDrawImagePoints", cast(void**)& GdipDrawImagePoints ), + Symbol( "GdipDrawImagePointsI", cast(void**)& GdipDrawImagePointsI ), + Symbol( "GdipDrawImagePointsRect", cast(void**)& GdipDrawImagePointsRect ), + Symbol( "GdipDrawImagePointsRectI", cast(void**)& GdipDrawImagePointsRectI ), + Symbol( "GdipIsVisiblePoint", cast(void**)& GdipIsVisiblePoint ), + Symbol( "GdipIsVisiblePointI", cast(void**)& GdipIsVisiblePointI ), + Symbol( "GdipIsVisibleRect", cast(void**)& GdipIsVisibleRect ), + Symbol( "GdipIsVisibleRectI", cast(void**)& GdipIsVisibleRectI ), + Symbol( "GdipGetTextRenderingHint", cast(void**)& GdipGetTextRenderingHint ), + Symbol( "GdipSetTextRenderingHint", cast(void**)& GdipSetTextRenderingHint ), + Symbol( "GdipGetClipBounds", cast(void**)& GdipGetClipBounds ), + Symbol( "GdipGetClipBoundsI", cast(void**)& GdipGetClipBoundsI ), + Symbol( "GdipGetVisibleClipBounds", cast(void**)& GdipGetVisibleClipBounds ), + Symbol( "GdipGetVisibleClipBoundsI", cast(void**)& GdipGetVisibleClipBoundsI ), + Symbol( "GdipIsClipEmpty", cast(void**)& GdipIsClipEmpty ), + Symbol( "GdipIsVisibleClipEmpty", cast(void**)& GdipIsVisibleClipEmpty ), + Symbol( "GdipGetRenderingOrigin", cast(void**)& GdipGetRenderingOrigin ), + Symbol( "GdipSetRenderingOrigin", cast(void**)& GdipSetRenderingOrigin ), + Symbol( "GdipGetNearestColor", cast(void**)& GdipGetNearestColor ), + Symbol( "GdipComment", cast(void**)& GdipComment ), + Symbol( "GdipTransformPoints", cast(void**)& GdipTransformPoints ), + Symbol( "GdipTransformPointsI", cast(void**)& GdipTransformPointsI ), + Symbol( "GdipCreateMatrix", cast(void**)& GdipCreateMatrix ), + Symbol( "GdipCreateMatrix2", cast(void**)& GdipCreateMatrix2 ), + Symbol( "GdipCreateMatrix3", cast(void**)& GdipCreateMatrix3 ), + Symbol( "GdipCreateMatrix3I", cast(void**)& GdipCreateMatrix3I ), + Symbol( "GdipDeleteMatrix", cast(void**)& GdipDeleteMatrix ), + Symbol( "GdipCloneMatrix", cast(void**)& GdipCloneMatrix ), + Symbol( "GdipGetMatrixElements", cast(void**)& GdipGetMatrixElements ), + Symbol( "GdipSetMatrixElements", cast(void**)& GdipSetMatrixElements ), + Symbol( "GdipInvertMatrix", cast(void**)& GdipInvertMatrix ), + Symbol( "GdipMultiplyMatrix", cast(void**)& GdipMultiplyMatrix ), + Symbol( "GdipScaleMatrix", cast(void**)& GdipScaleMatrix ), + Symbol( "GdipShearMatrix", cast(void**)& GdipShearMatrix ), + Symbol( "GdipRotateMatrix", cast(void**)& GdipRotateMatrix ), + Symbol( "GdipTranslateMatrix", cast(void**)& GdipTranslateMatrix ), + Symbol( "GdipIsMatrixIdentity", cast(void**)& GdipIsMatrixIdentity ), + Symbol( "GdipIsMatrixInvertible", cast(void**)& GdipIsMatrixInvertible ), + Symbol( "GdipTransformMatrixPoints", cast(void**)& GdipTransformMatrixPoints ), + Symbol( "GdipGetBrushType", cast(void**)& GdipGetBrushType ), + Symbol( "GdipCloneBrush", cast(void**)& GdipCloneBrush ), + Symbol( "GdipDeleteBrush", cast(void**)& GdipDeleteBrush ), + Symbol( "GdipCreateSolidFill", cast(void**)& GdipCreateSolidFill ), + Symbol( "GdipGetSolidFillColor", cast(void**)& GdipGetSolidFillColor ), + Symbol( "GdipSetSolidFillColor", cast(void**)& GdipSetSolidFillColor ), + Symbol( "GdipCreateTexture", cast(void**)& GdipCreateTexture ), + Symbol( "GdipCreateTexture2", cast(void**)& GdipCreateTexture2 ), + Symbol( "GdipCreateTexture2I", cast(void**)& GdipCreateTexture2I ), + Symbol( "GdipGetTextureImage", cast(void**)& GdipGetTextureImage ), + Symbol( "GdipGetTextureTransform", cast(void**)& GdipGetTextureTransform ), + Symbol( "GdipSetTextureTransform", cast(void**)& GdipSetTextureTransform ), + Symbol( "GdipGetTextureWrapMode", cast(void**)& GdipGetTextureWrapMode ), + Symbol( "GdipSetTextureWrapMode", cast(void**)& GdipSetTextureWrapMode ), + Symbol( "GdipCreateHatchBrush", cast(void**)& GdipCreateHatchBrush ), + Symbol( "GdipGetHatchStyle", cast(void**)& GdipGetHatchStyle ), + Symbol( "GdipGetHatchForegroundColor", cast(void**)& GdipGetHatchForegroundColor ), + Symbol( "GdipGetHatchBackgroundColor", cast(void**)& GdipGetHatchBackgroundColor ), + Symbol( "GdipCreateLineBrushI", cast(void**)& GdipCreateLineBrushI ), + Symbol( "GdipCreateLineBrush", cast(void**)& GdipCreateLineBrush ), + Symbol( "GdipCreateLineBrushFromRectI", cast(void**)& GdipCreateLineBrushFromRectI ), + Symbol( "GdipCreateLineBrushFromRect", cast(void**)& GdipCreateLineBrushFromRect ), + Symbol( "GdipCreateLineBrushFromRectWithAngleI", cast(void**)& GdipCreateLineBrushFromRectWithAngleI ), + Symbol( "GdipCreateLineBrushFromRectWithAngle", cast(void**)& GdipCreateLineBrushFromRectWithAngle ), + Symbol( "GdipGetLineBlendCount", cast(void**)& GdipGetLineBlendCount ), + Symbol( "GdipGetLineBlend", cast(void**)& GdipGetLineBlend ), + Symbol( "GdipSetLineBlend", cast(void**)& GdipSetLineBlend ), + Symbol( "GdipGetLinePresetBlendCount", cast(void**)& GdipGetLinePresetBlendCount ), + Symbol( "GdipGetLinePresetBlend", cast(void**)& GdipGetLinePresetBlend ), + Symbol( "GdipSetLinePresetBlend", cast(void**)& GdipSetLinePresetBlend ), + Symbol( "GdipGetLineWrapMode", cast(void**)& GdipGetLineWrapMode ), + Symbol( "GdipSetLineWrapMode", cast(void**)& GdipSetLineWrapMode ), + Symbol( "GdipGetLineRect", cast(void**)& GdipGetLineRect ), + Symbol( "GdipGetLineColors", cast(void**)& GdipGetLineColors ), + Symbol( "GdipSetLineColors", cast(void**)& GdipSetLineColors ), + Symbol( "GdipGetLineGammaCorrection", cast(void**)& GdipGetLineGammaCorrection ), + Symbol( "GdipSetLineGammaCorrection", cast(void**)& GdipSetLineGammaCorrection ), + Symbol( "GdipSetLineSigmaBlend", cast(void**)& GdipSetLineSigmaBlend ), + Symbol( "GdipSetLineLinearBlend", cast(void**)& GdipSetLineLinearBlend ), + Symbol( "GdipGetLineTransform", cast(void**)& GdipGetLineTransform ), + Symbol( "GdipSetLineTransform", cast(void**)& GdipSetLineTransform ), + Symbol( "GdipResetLineTransform", cast(void**)& GdipResetLineTransform ), + Symbol( "GdipMultiplyLineTransform", cast(void**)& GdipMultiplyLineTransform ), + Symbol( "GdipTranslateLineTransform", cast(void**)& GdipTranslateLineTransform ), + Symbol( "GdipScaleLineTransform", cast(void**)& GdipScaleLineTransform ), + Symbol( "GdipRotateLineTransform", cast(void**)& GdipRotateLineTransform ), + Symbol( "GdipCreatePen1", cast(void**)& GdipCreatePen1 ), + Symbol( "GdipCreatePen2", cast(void**)& GdipCreatePen2 ), + Symbol( "GdipDeletePen", cast(void**)& GdipDeletePen ), + Symbol( "GdipClonePen", cast(void**)& GdipClonePen ), + Symbol( "GdipSetPenLineCap197819", cast(void**)& GdipSetPenLineCap197819 ), + Symbol( "GdipGetPenStartCap", cast(void**)& GdipGetPenStartCap ), + Symbol( "GdipSetPenStartCap", cast(void**)& GdipSetPenStartCap ), + Symbol( "GdipGetPenEndCap", cast(void**)& GdipGetPenEndCap ), + Symbol( "GdipSetPenEndCap", cast(void**)& GdipSetPenEndCap ), + Symbol( "GdipGetPenDashCap197819", cast(void**)& GdipGetPenDashCap197819 ), + Symbol( "GdipSetPenDashCap197819", cast(void**)& GdipSetPenDashCap197819 ), + Symbol( "GdipGetPenLineJoin", cast(void**)& GdipGetPenLineJoin ), + Symbol( "GdipSetPenLineJoin", cast(void**)& GdipSetPenLineJoin ), + Symbol( "GdipGetPenMiterLimit", cast(void**)& GdipGetPenMiterLimit ), + Symbol( "GdipSetPenMiterLimit", cast(void**)& GdipSetPenMiterLimit ), + Symbol( "GdipGetPenMode", cast(void**)& GdipGetPenMode ), + Symbol( "GdipSetPenMode", cast(void**)& GdipSetPenMode ), + Symbol( "GdipGetPenTransform", cast(void**)& GdipGetPenTransform ), + Symbol( "GdipSetPenTransform", cast(void**)& GdipSetPenTransform ), + Symbol( "GdipResetPenTransform", cast(void**)& GdipResetPenTransform ), + Symbol( "GdipMultiplyPenTransform", cast(void**)& GdipMultiplyPenTransform ), + Symbol( "GdipTranslatePenTransform", cast(void**)& GdipTranslatePenTransform ), + Symbol( "GdipScalePenTransform", cast(void**)& GdipScalePenTransform ), + Symbol( "GdipRotatePenTransform", cast(void**)& GdipRotatePenTransform ), + Symbol( "GdipGetPenColor", cast(void**)& GdipGetPenColor ), + Symbol( "GdipSetPenColor", cast(void**)& GdipSetPenColor ), + Symbol( "GdipGetPenWidth", cast(void**)& GdipGetPenWidth ), + Symbol( "GdipSetPenWidth", cast(void**)& GdipSetPenWidth ), + Symbol( "GdipGetPenFillType", cast(void**)& GdipGetPenFillType ), + Symbol( "GdipGetPenBrushFill", cast(void**)& GdipGetPenBrushFill ), + Symbol( "GdipSetPenBrushFill", cast(void**)& GdipSetPenBrushFill ), + Symbol( "GdipGetPenDashStyle", cast(void**)& GdipGetPenDashStyle ), + Symbol( "GdipSetPenDashStyle", cast(void**)& GdipSetPenDashStyle ), + Symbol( "GdipGetPenDashOffset", cast(void**)& GdipGetPenDashOffset ), + Symbol( "GdipSetPenDashOffset", cast(void**)& GdipSetPenDashOffset ), + Symbol( "GdipGetPenDashCount", cast(void**)& GdipGetPenDashCount ), + Symbol( "GdipGetPenDashArray", cast(void**)& GdipGetPenDashArray ), + Symbol( "GdipSetPenDashArray", cast(void**)& GdipSetPenDashArray ), + Symbol( "GdipGetPenCompoundCount", cast(void**)& GdipGetPenCompoundCount ), + Symbol( "GdipGetPenCompoundArray", cast(void**)& GdipGetPenCompoundArray ), + Symbol( "GdipSetPenCompoundArray", cast(void**)& GdipSetPenCompoundArray ), + Symbol( "GdipCreateRegion", cast(void**)& GdipCreateRegion ), + Symbol( "GdipCreateRegionRect", cast(void**)& GdipCreateRegionRect ), + Symbol( "GdipCreateRegionRectI", cast(void**)& GdipCreateRegionRectI ), + Symbol( "GdipCreateRegionPath", cast(void**)& GdipCreateRegionPath ), + Symbol( "GdipCreateRegionHrgn", cast(void**)& GdipCreateRegionHrgn ), + Symbol( "GdipDeleteRegion", cast(void**)& GdipDeleteRegion ), + Symbol( "GdipSetInfinite", cast(void**)& GdipSetInfinite ), + Symbol( "GdipSetEmpty", cast(void**)& GdipSetEmpty ), + Symbol( "GdipCombineRegionRect", cast(void**)& GdipCombineRegionRect ), + Symbol( "GdipCombineRegionRectI", cast(void**)& GdipCombineRegionRectI ), + Symbol( "GdipCombineRegionPath", cast(void**)& GdipCombineRegionPath ), + Symbol( "GdipCombineRegionRegion", cast(void**)& GdipCombineRegionRegion ), + Symbol( "GdipTranslateRegion", cast(void**)& GdipTranslateRegion ), + Symbol( "GdipTranslateRegionI", cast(void**)& GdipTranslateRegionI ), + Symbol( "GdipTransformRegion", cast(void**)& GdipTransformRegion ), + Symbol( "GdipGetRegionBounds", cast(void**)& GdipGetRegionBounds ), + Symbol( "GdipGetRegionHRgn", cast(void**)& GdipGetRegionHRgn ), + Symbol( "GdipIsEmptyRegion", cast(void**)& GdipIsEmptyRegion ), + Symbol( "GdipIsInfiniteRegion", cast(void**)& GdipIsInfiniteRegion ), + Symbol( "GdipIsEqualRegion", cast(void**)& GdipIsEqualRegion ), + Symbol( "GdipIsVisibleRegionPoint", cast(void**)& GdipIsVisibleRegionPoint ), + Symbol( "GdipIsVisibleRegionRect", cast(void**)& GdipIsVisibleRegionRect ), + Symbol( "GdipIsVisibleRegionPointI", cast(void**)& GdipIsVisibleRegionPointI ), + Symbol( "GdipIsVisibleRegionRectI", cast(void**)& GdipIsVisibleRegionRectI ), + Symbol( "GdipGetRegionScansCount", cast(void**)& GdipGetRegionScansCount ), + Symbol( "GdipGetRegionScans", cast(void**)& GdipGetRegionScans ), + Symbol( "GdipDisposeImage", cast(void**)& GdipDisposeImage ), + Symbol( "GdipImageForceValidation", cast(void**)& GdipImageForceValidation ), + Symbol( "GdipLoadImageFromFileICM", cast(void**)& GdipLoadImageFromFileICM ), + Symbol( "GdipLoadImageFromFile", cast(void**)& GdipLoadImageFromFile ), + Symbol( "GdipGetImageEncodersSize", cast(void**)& GdipGetImageEncodersSize ), + Symbol( "GdipCloneImage", cast(void**)& GdipCloneImage ), + Symbol( "GdipGetImageType", cast(void**)& GdipGetImageType ), + Symbol( "GdipGetImageFlags", cast(void**)& GdipGetImageFlags ), + Symbol( "GdipGetImageWidth", cast(void**)& GdipGetImageWidth ), + Symbol( "GdipGetImageHeight", cast(void**)& GdipGetImageHeight ), + Symbol( "GdipGetImageHorizontalResolution", cast(void**)& GdipGetImageHorizontalResolution ), + Symbol( "GdipGetImageVerticalResolution", cast(void**)& GdipGetImageVerticalResolution ), + Symbol( "GdipGetPropertyCount", cast(void**)& GdipGetPropertyCount ), + Symbol( "GdipGetPropertyIdList", cast(void**)& GdipGetPropertyIdList ), + Symbol( "GdipGetImagePixelFormat", cast(void**)& GdipGetImagePixelFormat ), + Symbol( "GdipGetImageDimension", cast(void**)& GdipGetImageDimension ), + Symbol( "GdipGetImageThumbnail", cast(void**)& GdipGetImageThumbnail ), + Symbol( "GdipImageGetFrameDimensionsCount", cast(void**)& GdipImageGetFrameDimensionsCount ), + Symbol( "GdipImageRotateFlip", cast(void**)& GdipImageRotateFlip ), + Symbol( "GdipGetPropertyItemSize", cast(void**)& GdipGetPropertyItemSize ), + Symbol( "GdipGetPropertyItem", cast(void**)& GdipGetPropertyItem ), + Symbol( "GdipSetPropertyItem", cast(void**)& GdipSetPropertyItem ), + Symbol( "GdipRemovePropertyItem", cast(void**)& GdipRemovePropertyItem ), + Symbol( "GdipGetPropertySize", cast(void**)& GdipGetPropertySize ), + Symbol( "GdipGetAllPropertyItems", cast(void**)& GdipGetAllPropertyItems ), + Symbol( "GdipGetImageBounds", cast(void**)& GdipGetImageBounds ), + Symbol( "GdipGetImagePaletteSize", cast(void**)& GdipGetImagePaletteSize ), + Symbol( "GdipGetImagePalette", cast(void**)& GdipGetImagePalette ), + Symbol( "GdipSetImagePalette", cast(void**)& GdipSetImagePalette ), + Symbol( "GdipCreateBitmapFromScan0", cast(void**)& GdipCreateBitmapFromScan0 ), + Symbol( "GdipCreateBitmapFromHBITMAP", cast(void**)& GdipCreateBitmapFromHBITMAP ), + Symbol( "GdipCreateBitmapFromHICON", cast(void**)& GdipCreateBitmapFromHICON ), + Symbol( "GdipCreateBitmapFromFileICM", cast(void**)& GdipCreateBitmapFromFileICM ), + Symbol( "GdipCreateBitmapFromFile", cast(void**)& GdipCreateBitmapFromFile ), + Symbol( "GdipCreateBitmapFromGraphics", cast(void**)& GdipCreateBitmapFromGraphics ), + Symbol( "GdipCloneBitmapArea", cast(void**)& GdipCloneBitmapArea ), + Symbol( "GdipCloneBitmapAreaI", cast(void**)& GdipCloneBitmapAreaI ), + Symbol( "GdipBitmapGetPixel", cast(void**)& GdipBitmapGetPixel ), + Symbol( "GdipBitmapSetPixel", cast(void**)& GdipBitmapSetPixel ), + Symbol( "GdipBitmapLockBits", cast(void**)& GdipBitmapLockBits ), + Symbol( "GdipBitmapUnlockBits", cast(void**)& GdipBitmapUnlockBits ), + Symbol( "GdipBitmapSetResolution", cast(void**)& GdipBitmapSetResolution ), + Symbol( "GdipCreateHICONFromBitmap", cast(void**)& GdipCreateHICONFromBitmap ), + Symbol( "GdipCreateHBITMAPFromBitmap", cast(void**)& GdipCreateHBITMAPFromBitmap ), + Symbol( "GdipCreateImageAttributes", cast(void**)& GdipCreateImageAttributes ), + Symbol( "GdipDisposeImageAttributes", cast(void**)& GdipDisposeImageAttributes ), + Symbol( "GdipSetImageAttributesColorMatrix", cast(void**)& GdipSetImageAttributesColorMatrix ), + Symbol( "GdipSetImageAttributesThreshold", cast(void**)& GdipSetImageAttributesThreshold ), + Symbol( "GdipSetImageAttributesGamma", cast(void**)& GdipSetImageAttributesGamma ), + Symbol( "GdipSetImageAttributesNoOp", cast(void**)& GdipSetImageAttributesNoOp ), + Symbol( "GdipSetImageAttributesColorKeys", cast(void**)& GdipSetImageAttributesColorKeys ), + Symbol( "GdipSetImageAttributesOutputChannel", cast(void**)& GdipSetImageAttributesOutputChannel ), + Symbol( "GdipSetImageAttributesOutputChannelColorProfile", cast(void**)& GdipSetImageAttributesOutputChannelColorProfile ), + Symbol( "GdipSetImageAttributesWrapMode", cast(void**)& GdipSetImageAttributesWrapMode ), + Symbol( "GdipNewInstalledFontCollection", cast(void**)& GdipNewInstalledFontCollection ), + Symbol( "GdipNewPrivateFontCollection", cast(void**)& GdipNewPrivateFontCollection ), + Symbol( "GdipDeletePrivateFontCollection", cast(void**)& GdipDeletePrivateFontCollection ), + Symbol( "GdipPrivateAddFontFile", cast(void**)& GdipPrivateAddFontFile ), + Symbol( "GdipPrivateAddMemoryFont", cast(void**)& GdipPrivateAddMemoryFont ), + Symbol( "GdipGetFontCollectionFamilyCount", cast(void**)& GdipGetFontCollectionFamilyCount ), + Symbol( "GdipGetFontCollectionFamilyList", cast(void**)& GdipGetFontCollectionFamilyList ), + Symbol( "GdipCreateFontFamilyFromName", cast(void**)& GdipCreateFontFamilyFromName ), + Symbol( "GdipDeleteFontFamily", cast(void**)& GdipDeleteFontFamily ), + Symbol( "GdipCloneFontFamily", cast(void**)& GdipCloneFontFamily ), + Symbol( "GdipGetFamilyName", cast(void**)& GdipGetFamilyName ), + Symbol( "GdipGetGenericFontFamilyMonospace", cast(void**)& GdipGetGenericFontFamilyMonospace ), + Symbol( "GdipGetGenericFontFamilySerif", cast(void**)& GdipGetGenericFontFamilySerif ), + Symbol( "GdipGetGenericFontFamilySansSerif", cast(void**)& GdipGetGenericFontFamilySansSerif ), + Symbol( "GdipGetEmHeight", cast(void**)& GdipGetEmHeight ), + Symbol( "GdipGetCellAscent", cast(void**)& GdipGetCellAscent ), + Symbol( "GdipGetCellDescent", cast(void**)& GdipGetCellDescent ), + Symbol( "GdipGetLineSpacing", cast(void**)& GdipGetLineSpacing ), + Symbol( "GdipIsStyleAvailable", cast(void**)& GdipIsStyleAvailable ), + Symbol( "GdipCreateFont", cast(void**)& GdipCreateFont ), + Symbol( "GdipCreateFontFromDC", cast(void**)& GdipCreateFontFromDC ), + Symbol( "GdipDeleteFont", cast(void**)& GdipDeleteFont ), + Symbol( "GdipCloneFont", cast(void**)& GdipCloneFont ), + Symbol( "GdipGetFontSize", cast(void**)& GdipGetFontSize ), + Symbol( "GdipGetFontHeight", cast(void**)& GdipGetFontHeight ), + Symbol( "GdipGetFontHeightGivenDPI", cast(void**)& GdipGetFontHeightGivenDPI ), + Symbol( "GdipGetFontStyle", cast(void**)& GdipGetFontStyle ), + Symbol( "GdipGetFontUnit", cast(void**)& GdipGetFontUnit ), + Symbol( "GdipGetFamily", cast(void**)& GdipGetFamily ), + Symbol( "GdipCreateFontFromLogfontW", cast(void**)& GdipCreateFontFromLogfontW ), + Symbol( "GdipCreateFontFromLogfontA", cast(void**)& GdipCreateFontFromLogfontA ), + Symbol( "GdipGetLogFontW", cast(void**)& GdipGetLogFontW ), + Symbol( "GdipCreateStringFormat", cast(void**)& GdipCreateStringFormat ), + Symbol( "GdipDeleteStringFormat", cast(void**)& GdipDeleteStringFormat ), + Symbol( "GdipGetStringFormatFlags", cast(void**)& GdipGetStringFormatFlags ), + Symbol( "GdipSetStringFormatFlags", cast(void**)& GdipSetStringFormatFlags ), + Symbol( "GdipGetStringFormatAlign", cast(void**)& GdipGetStringFormatAlign ), + Symbol( "GdipSetStringFormatAlign", cast(void**)& GdipSetStringFormatAlign ), + Symbol( "GdipGetStringFormatLineAlign", cast(void**)& GdipGetStringFormatLineAlign ), + Symbol( "GdipSetStringFormatLineAlign", cast(void**)& GdipSetStringFormatLineAlign ), + Symbol( "GdipGetStringFormatTrimming", cast(void**)& GdipGetStringFormatTrimming ), + Symbol( "GdipSetStringFormatTrimming", cast(void**)& GdipSetStringFormatTrimming ), + Symbol( "GdipCreatePath", cast(void**)& GdipCreatePath ), + Symbol( "GdipCreatePath2", cast(void**)& GdipCreatePath2 ), + Symbol( "GdipCreatePath2I", cast(void**)& GdipCreatePath2I ), + Symbol( "GdipDeletePath", cast(void**)& GdipDeletePath ), + Symbol( "GdipClonePath", cast(void**)& GdipClonePath ), + Symbol( "GdipResetPath", cast(void**)& GdipResetPath ), + Symbol( "GdipGetPathFillMode", cast(void**)& GdipGetPathFillMode ), + Symbol( "GdipSetPathFillMode", cast(void**)& GdipSetPathFillMode ), + Symbol( "GdipStartPathFigure", cast(void**)& GdipStartPathFigure ), + Symbol( "GdipClosePathFigure", cast(void**)& GdipClosePathFigure ), + Symbol( "GdipClosePathFigures", cast(void**)& GdipClosePathFigures ), + Symbol( "GdipSetPathMarker", cast(void**)& GdipSetPathMarker ), + Symbol( "GdipClearPathMarkers", cast(void**)& GdipClearPathMarkers ), + Symbol( "GdipReversePath", cast(void**)& GdipReversePath ), + Symbol( "GdipGetPathLastPoint", cast(void**)& GdipGetPathLastPoint ), + Symbol( "GdipAddPathLine", cast(void**)& GdipAddPathLine ), + Symbol( "GdipAddPathLineI", cast(void**)& GdipAddPathLineI ), + Symbol( "GdipAddPathLine2", cast(void**)& GdipAddPathLine2 ), + Symbol( "GdipAddPathLine2I", cast(void**)& GdipAddPathLine2I ), + Symbol( "GdipAddPathArc", cast(void**)& GdipAddPathArc ), + Symbol( "GdipAddPathArcI", cast(void**)& GdipAddPathArcI ), + Symbol( "GdipAddPathBezier", cast(void**)& GdipAddPathBezier ), + Symbol( "GdipAddPathBezierI", cast(void**)& GdipAddPathBezierI ), + Symbol( "GdipAddPathBeziers", cast(void**)& GdipAddPathBeziers ), + Symbol( "GdipAddPathBeziersI", cast(void**)& GdipAddPathBeziersI ), + Symbol( "GdipAddPathCurve", cast(void**)& GdipAddPathCurve ), + Symbol( "GdipAddPathCurveI", cast(void**)& GdipAddPathCurveI ), + Symbol( "GdipAddPathCurve2", cast(void**)& GdipAddPathCurve2 ), + Symbol( "GdipAddPathCurve2I", cast(void**)& GdipAddPathCurve2I ), + Symbol( "GdipAddPathCurve3", cast(void**)& GdipAddPathCurve3 ), + Symbol( "GdipAddPathCurve3I", cast(void**)& GdipAddPathCurve3I ), + Symbol( "GdipAddPathClosedCurve", cast(void**)& GdipAddPathClosedCurve ), + Symbol( "GdipAddPathClosedCurveI", cast(void**)& GdipAddPathClosedCurveI ), + Symbol( "GdipAddPathClosedCurve2", cast(void**)& GdipAddPathClosedCurve2 ), + Symbol( "GdipAddPathClosedCurve2I", cast(void**)& GdipAddPathClosedCurve2I ), + Symbol( "GdipAddPathRectangle", cast(void**)& GdipAddPathRectangle ), + Symbol( "GdipAddPathRectangleI", cast(void**)& GdipAddPathRectangleI ), + Symbol( "GdipAddPathRectangles", cast(void**)& GdipAddPathRectangles ), + Symbol( "GdipAddPathRectanglesI", cast(void**)& GdipAddPathRectanglesI ), + Symbol( "GdipAddPathEllipse", cast(void**)& GdipAddPathEllipse ), + Symbol( "GdipAddPathEllipseI", cast(void**)& GdipAddPathEllipseI ), + Symbol( "GdipAddPathPie", cast(void**)& GdipAddPathPie ), + Symbol( "GdipAddPathPieI", cast(void**)& GdipAddPathPieI ), + Symbol( "GdipAddPathPolygon", cast(void**)& GdipAddPathPolygon ), + Symbol( "GdipAddPathPolygonI", cast(void**)& GdipAddPathPolygonI ), + Symbol( "GdipAddPathPath", cast(void**)& GdipAddPathPath ), + Symbol( "GdipAddPathString", cast(void**)& GdipAddPathString ), + Symbol( "GdipAddPathStringI", cast(void**)& GdipAddPathStringI ), + Symbol( "GdipTransformPath", cast(void**)& GdipTransformPath ), + Symbol( "GdipGetPathWorldBounds", cast(void**)& GdipGetPathWorldBounds ), + Symbol( "GdipFlattenPath", cast(void**)& GdipFlattenPath ), + Symbol( "GdipWidenPath", cast(void**)& GdipWidenPath ), + Symbol( "GdipWindingModeOutline", cast(void**)& GdipWindingModeOutline ), + Symbol( "GdipWarpPath", cast(void**)& GdipWarpPath ), + Symbol( "GdipGetPointCount", cast(void**)& GdipGetPointCount ), + Symbol( "GdipGetPathTypes", cast(void**)& GdipGetPathTypes ), + Symbol( "GdipGetPathPoints", cast(void**)& GdipGetPathPoints ), + Symbol( "GdipIsVisiblePathPoint", cast(void**)& GdipIsVisiblePathPoint ), + Symbol( "GdipIsVisiblePathPointI", cast(void**)& GdipIsVisiblePathPointI ), + Symbol( "GdipIsOutlineVisiblePathPoint", cast(void**)& GdipIsOutlineVisiblePathPoint ), + Symbol( "GdipIsOutlineVisiblePathPointI", cast(void**)& GdipIsOutlineVisiblePathPointI ), + Symbol( "GdipDrawPath", cast(void**)& GdipDrawPath ), + Symbol( "GdipCreatePathIter", cast(void**)& GdipCreatePathIter ), + Symbol( "GdipDeletePathIter", cast(void**)& GdipDeletePathIter ), + Symbol( "GdipPathIterNextSubpath", cast(void**)& GdipPathIterNextSubpath ), + Symbol( "GdipPathIterNextSubpathPath", cast(void**)& GdipPathIterNextSubpathPath ), + Symbol( "GdipPathIterNextPathType", cast(void**)& GdipPathIterNextPathType ), + Symbol( "GdipPathIterNextMarker", cast(void**)& GdipPathIterNextMarker ), + Symbol( "GdipPathIterNextMarkerPath", cast(void**)& GdipPathIterNextMarkerPath ), + Symbol( "GdipPathIterGetCount", cast(void**)& GdipPathIterGetCount ), + Symbol( "GdipPathIterGetSubpathCount", cast(void**)& GdipPathIterGetSubpathCount ), + Symbol( "GdipPathIterHasCurve", cast(void**)& GdipPathIterHasCurve ), + Symbol( "GdipPathIterRewind", cast(void**)& GdipPathIterRewind ), + Symbol( "GdipPathIterEnumerate", cast(void**)& GdipPathIterEnumerate ), + Symbol( "GdipPathIterCopyData", cast(void**)& GdipPathIterCopyData ), + Symbol( "GdipCreatePathGradient", cast(void**)& GdipCreatePathGradient ), + Symbol( "GdipCreatePathGradientI", cast(void**)& GdipCreatePathGradientI ), + Symbol( "GdipCreatePathGradientFromPath", cast(void**)& GdipCreatePathGradientFromPath ), + Symbol( "GdipGetPathGradientCenterColor", cast(void**)& GdipGetPathGradientCenterColor ), + Symbol( "GdipSetPathGradientCenterColor", cast(void**)& GdipSetPathGradientCenterColor ), + Symbol( "GdipGetPathGradientSurroundColorCount", cast(void**)& GdipGetPathGradientSurroundColorCount ), + Symbol( "GdipGetPathGradientSurroundColorsWithCount", cast(void**)& GdipGetPathGradientSurroundColorsWithCount ), + Symbol( "GdipSetPathGradientSurroundColorsWithCount", cast(void**)& GdipSetPathGradientSurroundColorsWithCount ), + Symbol( "GdipGetPathGradientCenterPoint", cast(void**)& GdipGetPathGradientCenterPoint ), + Symbol( "GdipSetPathGradientCenterPoint", cast(void**)& GdipSetPathGradientCenterPoint ), + Symbol( "GdipGetPathGradientRect", cast(void**)& GdipGetPathGradientRect ), + Symbol( "GdipGetPathGradientBlendCount", cast(void**)& GdipGetPathGradientBlendCount ), + Symbol( "GdipGetPathGradientBlend", cast(void**)& GdipGetPathGradientBlend ), + Symbol( "GdipSetPathGradientBlend", cast(void**)& GdipSetPathGradientBlend ), + Symbol( "GdipGetPathGradientPresetBlendCount", cast(void**)& GdipGetPathGradientPresetBlendCount ), + Symbol( "GdipGetPathGradientPresetBlend", cast(void**)& GdipGetPathGradientPresetBlend ), + Symbol( "GdipSetPathGradientPresetBlend", cast(void**)& GdipSetPathGradientPresetBlend ), + Symbol( "GdipSetPathGradientSigmaBlend", cast(void**)& GdipSetPathGradientSigmaBlend ), + Symbol( "GdipSetPathGradientLinearBlend", cast(void**)& GdipSetPathGradientLinearBlend ), + Symbol( "GdipGetPathGradientTransform", cast(void**)& GdipGetPathGradientTransform ), + Symbol( "GdipSetPathGradientTransform", cast(void**)& GdipSetPathGradientTransform ), + Symbol( "GdipResetPathGradientTransform", cast(void**)& GdipResetPathGradientTransform ), + Symbol( "GdipMultiplyPathGradientTransform", cast(void**)& GdipMultiplyPathGradientTransform ), + Symbol( "GdipRotatePathGradientTransform", cast(void**)& GdipRotatePathGradientTransform ), + Symbol( "GdipTranslatePathGradientTransform", cast(void**)& GdipTranslatePathGradientTransform ), + Symbol( "GdipScalePathGradientTransform", cast(void**)& GdipScalePathGradientTransform ), + Symbol( "GdipGetPathGradientFocusScales", cast(void**)& GdipGetPathGradientFocusScales ), + Symbol( "GdipSetPathGradientFocusScales", cast(void**)& GdipSetPathGradientFocusScales ), + Symbol( "GdipGetPathGradientWrapMode", cast(void**)& GdipGetPathGradientWrapMode ), + Symbol( "GdipSetPathGradientWrapMode", cast(void**)& GdipSetPathGradientWrapMode ), + Symbol( "GdipResetTextureTransform", cast(void**)& GdipResetTextureTransform ), + Symbol( "GdipScaleTextureTransform", cast(void**)& GdipScaleTextureTransform ), + Symbol( "GdipTranslateTextureTransform", cast(void**)& GdipTranslateTextureTransform ), + Symbol( "GdipStringFormatGetGenericDefault", cast(void**)& GdipStringFormatGetGenericDefault ), + Symbol( "GdipStringFormatGetGenericTypographic", cast(void**)& GdipStringFormatGetGenericTypographic ), + Symbol( "GdipSetStringFormatHotkeyPrefix", cast(void**)& GdipSetStringFormatHotkeyPrefix ), + Symbol( "GdipSetStringFormatTabStops", cast(void**)& GdipSetStringFormatTabStops ) + ]; +} void loadLib_Gdip(){ diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/GIFFileFormat.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/GIFFileFormat.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/GIFFileFormat.d Wed Mar 16 21:53:53 2011 +0900 @@ -127,7 +127,7 @@ if (id > 0) { /* We read the terminator earlier. */ byte[1] arr; - arr[0] = id; + arr[0] = cast(byte) id; inputStream.unread( arr ); } } catch (IOException e) { @@ -172,7 +172,7 @@ if (id is GIF_IMAGE_BLOCK_ID || id is GIF_TRAILER_ID) { try { byte[1] arr; - arr[0] = id; + arr[0] = cast(byte) id; inputStream.unread(arr); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/JPEGDecoder.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/JPEGDecoder.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/JPEGDecoder.d Wed Mar 16 21:53:53 2011 +0900 @@ -2348,7 +2348,7 @@ // #endif } else { /* We only need a single-MCU buffer. */ - foreach( inout el; coef.MCU_buffer ){ + foreach( ref el; coef.MCU_buffer ){ el = new short[](DCTSIZE2); } // coef.consume_data = dummy_consume_data; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/PngChunk.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/PngChunk.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/PngChunk.d Wed Mar 16 21:53:53 2011 +0900 @@ -50,17 +50,21 @@ static /*const*/ byte[] TYPE_IEND = cast(byte[])"IEND";//{(byte) 'I', (byte) 'E', (byte) 'N', (byte) 'D'}; static /*const*/ byte[] TYPE_tRNS = cast(byte[])"tRNS";//{(byte) 't', (byte) 'R', (byte) 'N', (byte) 'S'}; - static int[] CRC_TABLE; + private static int[] _CRC_TABLE = null; + static int[] CRC_TABLE() { + if (!_CRC_TABLE) static_this(); + return _CRC_TABLE; + } //public static void static_this() { - static this() { - CRC_TABLE = new int[256]; + private static void static_this() { + _CRC_TABLE = new int[256]; for (int i = 0; i < 256; i++) { - CRC_TABLE[i] = i; + _CRC_TABLE[i] = i; for (int j = 0; j < 8; j++) { - if ((CRC_TABLE[i] & 0x1) is 0) { - CRC_TABLE[i] = (CRC_TABLE[i] >> 1) & 0x7FFFFFFF; + if ((_CRC_TABLE[i] & 0x1) is 0) { + _CRC_TABLE[i] = (_CRC_TABLE[i] >> 1) & 0x7FFFFFFF; } else { - CRC_TABLE[i] = 0xEDB88320 ^ ((CRC_TABLE[i] >> 1) & 0x7FFFFFFF); + _CRC_TABLE[i] = 0xEDB88320 ^ ((_CRC_TABLE[i] >> 1) & 0x7FFFFFFF); } } } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/ole/win32/COM.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/ole/win32/COM.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/ole/win32/COM.d Wed Mar 16 21:53:53 2011 +0900 @@ -861,7 +861,7 @@ */ // BSTR is aliased to wchar* // Note : Free the "bstr" memory if freeTheString is true, default false -String BSTRToStr( /*BSTR*/ inout wchar* bstr, bool freeTheString = false){ +String BSTRToStr( /*BSTR*/ ref wchar* bstr, bool freeTheString = false){ if(bstr is null) return null; int size = (SysStringByteLen(bstr) + 1)/wchar.sizeof; String result = WCHARzToStr(bstr, size); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/ole/win32/OLEIDL.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/ole/win32/OLEIDL.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/ole/win32/OLEIDL.d Wed Mar 16 21:53:53 2011 +0900 @@ -408,7 +408,7 @@ interface IViewObject : IUnknown { - HRESULT Draw( DWORD dwDrawAspect, LONG lindex, void * pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL (*pfnContinue)(DWORD dwContinue), DWORD dwContinue ); + HRESULT Draw( DWORD dwDrawAspect, LONG lindex, void * pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL function(DWORD dwContinue) pfnContinue, DWORD dwContinue ); HRESULT GetColorSet( DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet ); HRESULT Freeze( DWORD dwDrawAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze ); HRESULT Unfreeze( DWORD dwFreeze ); diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/win32/OS.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/win32/OS.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/win32/OS.d Wed Mar 16 21:53:53 2011 +0900 @@ -227,7 +227,11 @@ // } /* Get the Windows version and the flags */ - public static this() { + static this(){ + static_this_1(); + static_this_2(); + static_this_3(); + static_this_4(); LDWTRESULT.ONE = new LDWTRESULT(1); LDWTRESULT.ZERO = new LDWTRESULT(0); /* @@ -328,7 +332,7 @@ */ if (!OS.IsWinCE && OS.WIN32_VERSION is OS.VERSION (5, 1)) { short langID = OS.GetSystemDefaultUILanguage (); - short primaryLang = OS.PRIMARYLANGID (langID); + short primaryLang = cast(short) OS.PRIMARYLANGID (langID); if (primaryLang is LANG_KOREAN) { OSVERSIONINFOEX infoex; infoex.dwOSVersionInfoSize = OSVERSIONINFOEX.sizeof; @@ -2668,23 +2672,25 @@ ) SetWindowTheme; } // public static - -static SymbolVersioned2[] Symbols_UxTheme = [ - { "IsAppThemed", cast(void**)& IsAppThemed, 5, 1 }, - { "DrawThemeBackground", cast(void**)& DrawThemeBackground, 5, 1 }, - { "DrawThemeEdge", cast(void**)& DrawThemeEdge, 5, 1 }, - { "DrawThemeIcon", cast(void**)& DrawThemeIcon, 5, 1 }, - { "DrawThemeParentBackground", cast(void**)& DrawThemeParentBackground, 5, 1 }, - { "DrawThemeText", cast(void**)& DrawThemeText, 5, 1 }, - { "OpenThemeData", cast(void**)& OpenThemeData, 5, 1 }, - { "CloseThemeData", cast(void**)& CloseThemeData, 5, 1 }, - { "GetThemeTextExtent", cast(void**)& GetThemeTextExtent, 5, 1 }, - { "SetWindowTheme", cast(void**)& SetWindowTheme, 5, 1 }, - { "BufferedPaintUnInit", cast(void**)& BufferedPaintUnInit, 6, 0 }, - { "BufferedPaintInit", cast(void**)& BufferedPaintInit, 6, 0 }, - { "BeginBufferedPaint", cast(void**)& BeginBufferedPaint, 6, 0 }, - { "EndBufferedPaint", cast(void**)& EndBufferedPaint, 6, 0 }, -]; +static SymbolVersioned2[] Symbols_UxTheme; +private static void static_this_1(){ + Symbols_UxTheme = [ + SymbolVersioned2( "IsAppThemed", cast(void**)& IsAppThemed, 5, 1 ), + SymbolVersioned2( "DrawThemeBackground", cast(void**)& DrawThemeBackground, 5, 1 ), + SymbolVersioned2( "DrawThemeEdge", cast(void**)& DrawThemeEdge, 5, 1 ), + SymbolVersioned2( "DrawThemeIcon", cast(void**)& DrawThemeIcon, 5, 1 ), + SymbolVersioned2( "DrawThemeParentBackground", cast(void**)& DrawThemeParentBackground, 5, 1 ), + SymbolVersioned2( "DrawThemeText", cast(void**)& DrawThemeText, 5, 1 ), + SymbolVersioned2( "OpenThemeData", cast(void**)& OpenThemeData, 5, 1 ), + SymbolVersioned2( "CloseThemeData", cast(void**)& CloseThemeData, 5, 1 ), + SymbolVersioned2( "GetThemeTextExtent", cast(void**)& GetThemeTextExtent, 5, 1 ), + SymbolVersioned2( "SetWindowTheme", cast(void**)& SetWindowTheme, 5, 1 ), + SymbolVersioned2( "BufferedPaintUnInit", cast(void**)& BufferedPaintUnInit, 6, 0 ), + SymbolVersioned2( "BufferedPaintInit", cast(void**)& BufferedPaintInit, 6, 0 ), + SymbolVersioned2( "BeginBufferedPaint", cast(void**)& BeginBufferedPaint, 6, 0 ), + SymbolVersioned2( "EndBufferedPaint", cast(void**)& EndBufferedPaint, 6, 0 ) + ]; +} static void loadLib_UxTheme(){ SharedLib.loadLibSymbols( Symbols_UxTheme, "uxtheme.dll", WIN32_MAJOR, WIN32_MINOR ); @@ -2726,13 +2732,16 @@ BOOL function( HWND hWnd )IsHungAppWindow; } -static SymbolVersioned2[] Symbols_User32 = [ - { "SetProcessDPIAware", cast(void**)& SetProcessDPIAware, 6, 0 }, - { "GetLayeredWindowAttributes", cast(void**)& GetLayeredWindowAttributes, 5, 1 }, - { "SetLayeredWindowAttributes", cast(void**)& SetLayeredWindowAttributes, 5, 0 }, - { "PrintWindow", cast(void**)& PrintWindow, 5, 1 }, - { "IsHungAppWindow", cast(void**)& IsHungAppWindow, 5, 0 }, -]; +static SymbolVersioned2[] Symbols_User32; +private static void static_this_2(){ + Symbols_User32 = [ + SymbolVersioned2( "SetProcessDPIAware", cast(void**)& SetProcessDPIAware, 6, 0 ), + SymbolVersioned2( "GetLayeredWindowAttributes", cast(void**)& GetLayeredWindowAttributes, 5, 1 ), + SymbolVersioned2( "SetLayeredWindowAttributes", cast(void**)& SetLayeredWindowAttributes, 5, 0 ), + SymbolVersioned2( "PrintWindow", cast(void**)& PrintWindow, 5, 1 ), + SymbolVersioned2( "IsHungAppWindow", cast(void**)& IsHungAppWindow, 5, 0 ) + ]; +} // Imm32.lib public static extern(Windows) { @@ -2787,39 +2796,45 @@ } -static SymbolVersioned2[] Symbols_Imm32 = [ - { "ImmAssociateContext", cast(void**)& ImmAssociateContext, 5, 1 }, - { "ImmCreateContext", cast(void**)& ImmCreateContext, 5, 1 }, - { "ImmDestroyContext", cast(void**)& ImmDestroyContext, 5, 1 }, - { "ImmGetContext", cast(void**)& ImmGetContext, 5, 1 }, - { "ImmGetConversionStatus", cast(void**)& ImmGetConversionStatus, 5, 1 }, - { "ImmGetDefaultIMEWnd", cast(void**)& ImmGetDefaultIMEWnd, 5, 1 }, - { "ImmGetOpenStatus", cast(void**)& ImmGetOpenStatus, 5, 1 }, - { "ImmReleaseContext", cast(void**)& ImmReleaseContext, 5, 1 }, - { "ImmSetCompositionFontW", cast(void**)& ImmSetCompositionFont, 5, 1 }, - { "ImmGetCompositionStringW", cast(void**)& ImmGetCompositionString, 5, 1 }, - { "ImmGetCompositionFontW", cast(void**)& ImmGetCompositionFont, 5, 1 }, - { "ImmSetCompositionWindow", cast(void**)& ImmSetCompositionWindow, 5, 1 }, - { "ImmSetConversionStatus", cast(void**)& ImmSetConversionStatus, 5, 1 }, - { "ImmSetOpenStatus", cast(void**)& ImmSetOpenStatus, 5, 1 }, - { "ImmDisableTextFrameService", cast(void**)& ImmDisableTextFrameService, 5, 1 }, - { "ImmNotifyIME", cast(void**)& ImmNotifyIME, 5, 1 }, - { "ImmGetCompositionStringW", cast(void**)& ImmGetCompositionStringW, 5, 1 }, - { "ImmGetCompositionStringA", cast(void**)& ImmGetCompositionStringA, 5, 1 }, - { "ImmSetCandidateWindow", cast(void**)& ImmSetCandidateWindow, 5, 1 }, -]; +static SymbolVersioned2[] Symbols_Imm32; +private static void static_this_3(){ + Symbols_Imm32 = [ + SymbolVersioned2( "ImmAssociateContext", cast(void**)& ImmAssociateContext, 5, 1 ), + SymbolVersioned2( "ImmCreateContext", cast(void**)& ImmCreateContext, 5, 1 ), + SymbolVersioned2( "ImmDestroyContext", cast(void**)& ImmDestroyContext, 5, 1 ), + SymbolVersioned2( "ImmGetContext", cast(void**)& ImmGetContext, 5, 1 ), + SymbolVersioned2( "ImmGetConversionStatus", cast(void**)& ImmGetConversionStatus, 5, 1 ), + SymbolVersioned2( "ImmGetDefaultIMEWnd", cast(void**)& ImmGetDefaultIMEWnd, 5, 1 ), + SymbolVersioned2( "ImmGetOpenStatus", cast(void**)& ImmGetOpenStatus, 5, 1 ), + SymbolVersioned2( "ImmReleaseContext", cast(void**)& ImmReleaseContext, 5, 1 ), + SymbolVersioned2( "ImmSetCompositionFontW", cast(void**)& ImmSetCompositionFont, 5, 1 ), + SymbolVersioned2( "ImmGetCompositionStringW", cast(void**)& ImmGetCompositionString, 5, 1 ), + SymbolVersioned2( "ImmGetCompositionFontW", cast(void**)& ImmGetCompositionFont, 5, 1 ), + SymbolVersioned2( "ImmSetCompositionWindow", cast(void**)& ImmSetCompositionWindow, 5, 1 ), + SymbolVersioned2( "ImmSetConversionStatus", cast(void**)& ImmSetConversionStatus, 5, 1 ), + SymbolVersioned2( "ImmSetOpenStatus", cast(void**)& ImmSetOpenStatus, 5, 1 ), + SymbolVersioned2( "ImmDisableTextFrameService", cast(void**)& ImmDisableTextFrameService, 5, 1 ), + SymbolVersioned2( "ImmNotifyIME", cast(void**)& ImmNotifyIME, 5, 1 ), + SymbolVersioned2( "ImmGetCompositionStringW", cast(void**)& ImmGetCompositionStringW, 5, 1 ), + SymbolVersioned2( "ImmGetCompositionStringA", cast(void**)& ImmGetCompositionStringA, 5, 1 ), + SymbolVersioned2( "ImmSetCandidateWindow", cast(void**)& ImmSetCandidateWindow, 5, 1 ) + ]; +} version(ANSI){ }else{ -static SymbolVersioned2[] Symbols_Kernel32 = [ - { "CreateActCtxW", cast(void**)& CreateActCtx, 5, 1 }, - { "ActivateActCtx", cast(void**)& ActivateActCtx, 5, 1 }, - { "GetSystemDefaultUILanguage", cast(void**)& GetSystemDefaultUILanguage, 5, 0 }, - { "EnumSystemLanguageGroupsW", cast(void**)& EnumSystemLanguageGroupsW, 4, 0 }, - { "EnumSystemLanguageGroupsA", cast(void**)& EnumSystemLanguageGroupsA, 4, 0 }, - { "EnumSystemLocalesW", cast(void**)& EnumSystemLocalesW, 4, 0 }, - { "EnumSystemLocalesA", cast(void**)& EnumSystemLocalesA, 4, 0 }, -]; +static SymbolVersioned2[] Symbols_Kernel32; +private static void static_this_4(){ + Symbols_Kernel32 = [ + SymbolVersioned2( "CreateActCtxW", cast(void**)& CreateActCtx, 5, 1 ), + SymbolVersioned2( "ActivateActCtx", cast(void**)& ActivateActCtx, 5, 1 ), + SymbolVersioned2( "GetSystemDefaultUILanguage", cast(void**)& GetSystemDefaultUILanguage, 5, 0 ), + SymbolVersioned2( "EnumSystemLanguageGroupsW", cast(void**)& EnumSystemLanguageGroupsW, 4, 0 ), + SymbolVersioned2( "EnumSystemLanguageGroupsA", cast(void**)& EnumSystemLanguageGroupsA, 4, 0 ), + SymbolVersioned2( "EnumSystemLocalesW", cast(void**)& EnumSystemLocalesW, 4, 0 ), + SymbolVersioned2( "EnumSystemLocalesA", cast(void**)& EnumSystemLocalesA, 4, 0 ) + ]; +} } @@ -3568,7 +3583,7 @@ } } -static void POINTSTOPOINT( inout POINT pt, int pts) { +static void POINTSTOPOINT( ref POINT pt, int pts) { pt.x = cast(SHORT) LOWORD(pts); pt.y = cast(SHORT) HIWORD(pts); } diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/win32/WINTYPES.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/win32/WINTYPES.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/win32/WINTYPES.d Wed Mar 16 21:53:53 2011 +0900 @@ -251,56 +251,56 @@ alias TOKEN_TYPE TAGTOKEN_TYPE; extern(Windows){ - alias int (*BFFCALLBACK)(HWND, UINT, LPARAM, LPARAM); - alias UINT (*LPCCHOOKPROC)(HWND, UINT, WPARAM, LPARAM); - alias UINT (*LPCFHOOKPROC)(HWND, UINT, WPARAM, LPARAM); + alias int function(HWND, UINT, LPARAM, LPARAM) BFFCALLBACK; + alias UINT function(HWND, UINT, WPARAM, LPARAM) LPCCHOOKPROC; + alias UINT function(HWND, UINT, WPARAM, LPARAM) LPCFHOOKPROC; alias POINTER PTHREAD_START_ROUTINE; alias PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; - alias DWORD (*EDITSTREAMCALLBACK)(DWORD, LPBYTE, LONG, LONG); - alias UINT (*LPFRHOOKPROC)(HWND, UINT, WPARAM, LPARAM); - alias UINT (*LPOFNHOOKPROC)(HWND, UINT, WPARAM, LPARAM); - alias UINT (*LPPRINTHOOKPROC)(HWND, UINT, WPARAM, LPARAM); - alias UINT (*LPSETUPHOOKPROC)(HWND, UINT, WPARAM, LPARAM); - alias LRESULT (*DLGPROC)(HWND, UINT, WPARAM, LPARAM); - alias int (*PFNPROPSHEETCALLBACK)(HWND, UINT, LPARAM); - alias void (*LPSERVICE_MAIN_FUNCTION)(DWORD, LPTSTR); - alias int (*PFNTVCOMPARE)(LPARAM, LPARAM, LPARAM); - alias LRESULT (*WNDPROC)(HWND, UINT, WPARAM, LPARAM); + alias DWORD function(DWORD, LPBYTE, LONG, LONG) EDITSTREAMCALLBACK; + alias UINT function(HWND, UINT, WPARAM, LPARAM) LPFRHOOKPROC; + alias UINT function(HWND, UINT, WPARAM, LPARAM) LPOFNHOOKPROC; + alias UINT function(HWND, UINT, WPARAM, LPARAM) LPPRINTHOOKPROC; + alias UINT function(HWND, UINT, WPARAM, LPARAM) LPSETUPHOOKPROC; + alias LRESULT function(HWND, UINT, WPARAM, LPARAM) DLGPROC; + alias int function(HWND, UINT, LPARAM) PFNPROPSHEETCALLBACK; + alias void function(DWORD, LPTSTR) LPSERVICE_MAIN_FUNCTION; + alias int function(LPARAM, LPARAM, LPARAM) PFNTVCOMPARE; + alias LRESULT function(HWND, UINT, WPARAM, LPARAM) WNDPROC; alias POINTER FARPROC; alias FARPROC PROC; - alias WINBOOL (*ENUMRESTYPEPROC)(HANDLE, LPTSTR, LONG); - alias WINBOOL (*ENUMRESNAMEPROC)(HANDLE, LPCTSTR, LPTSTR, LONG); - alias WINBOOL (*ENUMRESLANGPROC)(HANDLE, LPCTSTR, LPCTSTR, ushort, LONG); + alias WINBOOL function(HANDLE, LPTSTR, LONG) ENUMRESTYPEPROC; + alias WINBOOL function(HANDLE, LPCTSTR, LPTSTR, LONG) ENUMRESNAMEPROC; + alias WINBOOL function(HANDLE, LPCTSTR, LPCTSTR, ushort, LONG) ENUMRESLANGPROC; alias FARPROC DESKTOPENUMPROC; - alias WINBOOL (*ENUMWINDOWSPROC)(HWND, LPARAM); - alias WINBOOL (*ENUMWINDOWSTATIONPROC)(LPTSTR, LPARAM); - alias void (*SENDASYNCPROC)(HWND, UINT, DWORD); - alias void (*TIMERPROC)(HWND, UINT, UINT, DWORD); - alias BOOL(*MONITORENUMPROC)(HMONITOR, HDC, RECT*, LPARAM); + alias WINBOOL function(HWND, LPARAM) ENUMWINDOWSPROC; + alias WINBOOL function(LPTSTR, LPARAM) ENUMWINDOWSTATIONPROC; + alias void function(HWND, UINT, DWORD) SENDASYNCPROC; + alias void function(HWND, UINT, UINT, DWORD) TIMERPROC; + alias BOOL function(HMONITOR, HDC, RECT*, LPARAM) MONITORENUMPROC; alias FARPROC GRAYSTRINGPROC; - alias WINBOOL (*DRAWSTATEPROC)(HDC, LPARAM, WPARAM, int, int); - alias WINBOOL (*PROPENUMPROCEX)(HWND, LPCTSTR, HANDLE, DWORD); - alias WINBOOL (*PROPENUMPROC)(HWND, LPCTSTR, HANDLE); - alias LRESULT (*HOOKPROC)(int, WPARAM, LPARAM); - alias void (*ENUMOBJECTSPROC)(LPVOID); - alias void (*LINEDDAPROC)(int, int); - alias WINBOOL (*TABORTPROC)(HDC, int); - alias UINT (*LPPAGEPAINTHOOK)(HWND, UINT, WPARAM, LPARAM); - alias UINT (*LPPAGESETUPHOOK)(HWND, UINT, WPARAM, LPARAM); - alias int (*ICMENUMPROC)(LPTSTR, LPARAM); - alias LONG (*EDITWORDBREAKPROCEX)(PCHAR, LONG, ubyte, INT); - alias int (*PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM); - alias WINBOOL (*LOCALE_ENUMPROC)(LPTSTR); - alias WINBOOL (*CODEPAGE_ENUMPROC)(LPTSTR); - alias WINBOOL (*DATEFMT_ENUMPROC)(LPTSTR); - alias WINBOOL (*TIMEFMT_ENUMPROC)(LPTSTR); - alias WINBOOL (*CALINFO_ENUMPROC)(LPTSTR); - alias WINBOOL (*PHANDLER_ROUTINE)(DWORD); - alias WINBOOL (*LPHANDLER_FUNCTION)(DWORD); - alias void (*PTIMERAPCROUTINE)(LPVOID, DWORD, DWORD); - alias UINT (*PFNGETPROFILEPATH)(LPCTSTR, LPSTR, UINT); - alias UINT (*PFNRECONCILEPROFILE)(LPCTSTR, LPCTSTR, DWORD); - alias WINBOOL (*PFNPROCESSPOLICIES)(HWND, LPCTSTR, LPCTSTR, LPCTSTR, DWORD); + alias WINBOOL function(HDC, LPARAM, WPARAM, int, int) DRAWSTATEPROC; + alias WINBOOL function(HWND, LPCTSTR, HANDLE, DWORD) PROPENUMPROCEX; + alias WINBOOL function(HWND, LPCTSTR, HANDLE) PROPENUMPROC; + alias LRESULT function(int, WPARAM, LPARAM) HOOKPROC; + alias void function(LPVOID) ENUMOBJECTSPROC; + alias void function(int, int) LINEDDAPROC; + alias WINBOOL function(HDC, int) TABORTPROC; + alias UINT function(HWND, UINT, WPARAM, LPARAM) LPPAGEPAINTHOOK; + alias UINT function(HWND, UINT, WPARAM, LPARAM) LPPAGESETUPHOOK; + alias int function(LPTSTR, LPARAM) ICMENUMPROC; + alias LONG function(PCHAR, LONG, ubyte, INT) EDITWORDBREAKPROCEX; + alias int function(LPARAM, LPARAM, LPARAM) PFNLVCOMPARE; + alias WINBOOL function(LPTSTR) LOCALE_ENUMPROC; + alias WINBOOL function(LPTSTR) CODEPAGE_ENUMPROC; + alias WINBOOL function(LPTSTR) DATEFMT_ENUMPROC; + alias WINBOOL function(LPTSTR) TIMEFMT_ENUMPROC; + alias WINBOOL function(LPTSTR) CALINFO_ENUMPROC; + alias WINBOOL function(DWORD) PHANDLER_ROUTINE; + alias WINBOOL function(DWORD) LPHANDLER_FUNCTION; + alias void function(LPVOID, DWORD, DWORD) PTIMERAPCROUTINE; + alias UINT function(LPCTSTR, LPSTR, UINT) PFNGETPROFILEPATH; + alias UINT function(LPCTSTR, LPCTSTR, DWORD) PFNRECONCILEPROFILE; + alias WINBOOL function(HWND, LPCTSTR, LPCTSTR, LPCTSTR, DWORD) PFNPROCESSPOLICIES; } const { @@ -348,7 +348,7 @@ } extern(Windows){ - alias HDDEDATA (*PFNCALLBACK)(UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD); + alias HDDEDATA function(UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD) PFNCALLBACK; } alias PFNCALLBACK CALLB; alias WINBOOL SECURITY___FILE___TRACKING_MODE; @@ -10882,7 +10882,7 @@ alias MSG TMSG; alias MSG* PMSG; extern(Windows){ - alias void (*MSGBOXCALLBACK)(LPHELPINFO); + alias void function(LPHELPINFO) MSGBOXCALLBACK; } alias MSGBOXCALLBACK TMSGBOXCALLBACK; @@ -12105,7 +12105,7 @@ alias PROCESS_INFORMATION _PROCESS_INFORMATION; alias PROCESS_INFORMATION TPROCESSINFORMATION; alias PROCESS_INFORMATION* PPROCESSINFORMATION; - extern(Windows){alias UINT (*LPFNPSPCALLBACK)(HWND, UINT, LPVOID);} + extern(Windows){alias UINT function(HWND, UINT, LPVOID) LPFNPSPCALLBACK;} alias LPFNPSPCALLBACK TFNPSPCALLBACK; @@ -12230,8 +12230,8 @@ alias PROPSHEETHEADER TPROPSHEETHEADER; alias PROPSHEETHEADER* PPROPSHEETHEADER; extern(Windows){ - alias WINBOOL (*LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM); - alias WINBOOL (*LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE, LPARAM); + alias WINBOOL function(HPROPSHEETPAGE, LPARAM) LPFNADDPROPSHEETPAGE; + alias WINBOOL function(LPVOID, LPFNADDPROPSHEETPAGE, LPARAM) LPFNADDPROPSHEETPAGES; } alias LPFNADDPROPSHEETPAGE TFNADDPROPSHEETPAGE; alias LPFNADDPROPSHEETPAGES TFNADDPROPSHEETPAGES; @@ -13817,12 +13817,12 @@ alias NETCONNECTINFOSTRUCT TNETCONNECTINFOSTRUCT; alias NETCONNECTINFOSTRUCT* PNETCONNECTINFOSTRUCT; extern(Windows){ - alias int (*ENUMMETAFILEPROC)(HDC, HANDLETABLE*, METARECORD*, int, LPARAM); - alias int (*ENHMETAFILEPROC)(HDC, HANDLETABLE*, ENHMETARECORD*, int, LPARAM); - alias int (*ENUMFONTSPROC)(LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM); - alias int (*FONTENUMPROC)(ENUMLOGFONT*, NEWTEXTMETRIC*, int, LPARAM); - alias int (*FONTENUMEXPROC)(ENUMLOGFONTEX*, NEWTEXTMETRICEX*, int, LPARAM); - alias void (*LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD, DWORD); + alias int function(HDC, HANDLETABLE*, METARECORD*, int, LPARAM) ENUMMETAFILEPROC; + alias int function(HDC, HANDLETABLE*, ENHMETARECORD*, int, LPARAM) ENHMETAFILEPROC; + alias int function(LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM) ENUMFONTSPROC; + alias int function(ENUMLOGFONT*, NEWTEXTMETRIC*, int, LPARAM) FONTENUMPROC; + alias int function(ENUMLOGFONTEX*, NEWTEXTMETRICEX*, int, LPARAM) FONTENUMEXPROC; + alias void function(DWORD, DWORD) LPOVERLAPPED_COMPLETION_ROUTINE; } struct POINTFLOAT diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Canvas.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Canvas.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Canvas.d Wed Mar 16 21:53:53 2011 +0900 @@ -395,7 +395,7 @@ if (!OS.IsWinCE && OS.WIN32_VERSION is OS.VERSION (5, 1)) { if (OS.IsDBLocale) { short langID = OS.GetSystemDefaultUILanguage (); - short primaryLang = OS.PRIMARYLANGID (langID); + short primaryLang = cast(short) OS.PRIMARYLANGID (langID); if (primaryLang is OS.LANG_KOREAN) { if (caret !is null && caret.isFocusCaret ()) { POINT ptCurrentPos; diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Combo.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Combo.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Combo.d Wed Mar 16 21:53:53 2011 +0900 @@ -1340,7 +1340,7 @@ } if (event.character is 0) return true; if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return true; - char key = event.character; + char key = cast(char) event.character; int stateMask = event.stateMask; /* diff -r b6e9904989ed -r 9f4c18c268b2 org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Control.d --- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Control.d Sat Nov 13 14:15:51 2010 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Control.d Wed Mar 16 21:53:53 2011 +0900 @@ -3556,7 +3556,7 @@ case SWT.TRAVERSE_TAB_PREVIOUS: return traverseGroup (false); case SWT.TRAVERSE_ARROW_NEXT: return traverseItem (true); case SWT.TRAVERSE_ARROW_PREVIOUS: return traverseItem (false); - case SWT.TRAVERSE_MNEMONIC: return traverseMnemonic (event.character); + case SWT.TRAVERSE_MNEMONIC: return traverseMnemonic (cast(char) event.character); case SWT.TRAVERSE_PAGE_NEXT: return traversePage (true); case SWT.TRAVERSE_PAGE_PREVIOUS: return traversePage (false); default: @@ -4564,9 +4564,9 @@ Decorations shell = menuShell (); Menu menu = shell.getMenuBar (); if (menu !is null) { - char key = Display.mbcsToWcs (lParam); + char key = cast(char) Display.mbcsToWcs (lParam, 0); if (key !is 0) { - key = CharacterToLower (key); + key = cast(char) CharacterToLower (key); MenuItem [] items = menu.getItems (); for (int i=0; i#{srcdir_abs.to_path}" + STDERR.puts "workdir=>#{win_path(srcdir_abs)}" FileUtils.mkdir_p DIR_IMP FileUtils.mkdir_p DIR_OBJ @@ -127,10 +124,10 @@ rsp = File.new( FILE_RSP, "w+" ) rsp.puts "-H" - #rsp.puts "-Hd#{DIR_IMP.to_path}" - rsp.puts "-I#{srcdir_abs.to_path}" - rsp.puts "-I#{DIR_IMP.to_path}" - rsp.puts "-J#{DIR_RES.to_path}" + #rsp.puts "-Hd#{win_path(DIR_IMP)}" + rsp.puts "-I#{win_path(srcdir_abs)}" + rsp.puts "-I#{win_path(DIR_IMP)}" + rsp.puts "-J#{win_path(DIR_RES)}" if dcargs != nil rsp.puts dcargs end @@ -142,16 +139,16 @@ end Find.find( srcdir_abs ) do |path| if path =~ /\.d$/ then - rsp.puts path.to_path[ srcdir_abs.size+1 .. -1 ] + rsp.puts win_path(path)[ srcdir_abs.size+1 .. -1 ] end end rsp.close Dir.chdir(srcdir_abs) do if isWindows - cmd = "#{PROG_DMD} @#{FILE_RSP.to_path}" + cmd = "#{PROG_DMD} @#{win_path(FILE_RSP)}" else - cmd = "cat #{FILE_RSP.to_path} | xargs #{PROG_DMD}" + cmd = "cat #{win_path(FILE_RSP)} | xargs #{PROG_DMD}" end sh cmd, :verbose => false do |ok, res| if !ok then @@ -191,22 +188,22 @@ end def createLib( libobjs, name ) - FileUtils.mkdir_p DIR_LIB.to_path + FileUtils.mkdir_p win_path(DIR_LIB) file_lib = File.join(DIR_LIB, name + LIBEXT) FileUtils.rm_f file_lib rsp = File.new( FILE_RSP, "w+" ) if isWindows rsp.puts "-p512" rsp.puts "-n" - rsp.puts "-c #{file_lib.to_path}" + rsp.puts "-c #{win_path(file_lib)}" libobjs.each do |obj| - rsp.puts obj.to_path + rsp.puts win_path(obj) end else rsp.puts "-r" - rsp.puts "-c #{file_lib.to_path}" + rsp.puts "-c #{win_path(file_lib)}" libobjs.each do |obj| - rsp.puts obj.to_path + rsp.puts win_path(obj) end end rsp.close @@ -229,10 +226,10 @@ resdir_abs = File.expand_path( File.join( basedir, resdir)) rsp = File.new( FILE_RSP, "w+" ) - rsp.puts "-I#{srcdir_abs.to_path}" - rsp.puts "-I#{DIR_IMP.to_path}" - rsp.puts "-J#{resdir_abs.to_path}" - rsp.puts "-J#{DIR_RES.to_path}" + rsp.puts "-I#{win_path(srcdir_abs)}" + rsp.puts "-I#{win_path(DIR_IMP)}" + rsp.puts "-J#{win_path(resdir_abs)}" + rsp.puts "-J#{win_path(DIR_RES)}" if isDebug rsp.puts "-debug" rsp.puts "-g" @@ -242,11 +239,11 @@ end rsp.puts "-op" - rsp.puts "-od#{DIR_OBJ.to_path}" + rsp.puts "-od#{win_path(DIR_OBJ)}" applfile = File.join(DIR_BIN ,appnameprefix+appname+EXEEXT) - rsp.puts "-of#{applfile.to_path}" + rsp.puts "-of#{win_path(applfile)}" filelist.each do |path| - rsp.puts File.expand_path(path).to_path[ srcdir_abs.size+1 .. -1 ] + rsp.puts win_path(File.expand_path(path))[ srcdir_abs.size+1 .. -1 ] end if isWindows @@ -254,9 +251,9 @@ libnames.each do | libname | rsp.puts "-L+#{libname}#{LIBEXT}" end - rsp.puts "-L+#{DIR_LIB.to_path}\\" + rsp.puts "-L+#{win_path(DIR_LIB)}\\" else - rsp.puts "-L-L#{DIR_LIB.to_path}" + rsp.puts "-L-L#{win_path(DIR_LIB)}" libnames.reverse.each do | libname | absname = File.join( DIR_LIB, "#{libname}#{LIBEXT}" ); rsp.puts absname @@ -270,9 +267,9 @@ Dir.chdir(srcdir_abs) do if isWindows - cmd = "#{PROG_DMD} @#{FILE_RSP.to_path}" + cmd = "#{PROG_DMD} @#{win_path(FILE_RSP)}" else - cmd = "cat #{FILE_RSP.to_path} | xargs #{PROG_DMD}" + cmd = "cat #{win_path(FILE_RSP)} | xargs #{PROG_DMD}" end sh cmd, :verbose => false do |ok, res| if !ok then