Mercurial > projects > dwt2
changeset 109:8ae65ae167f5
Updated swt win32 for DMD 1.063 and latest Tango trunk.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Wed, 15 Sep 2010 16:42:28 +0200 |
parents | b397a43d66d1 |
children | 5d01af878529 |
files | base/src/java/lang/Thread.d org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet130a.d org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet133.d org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet142.d org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet146.d org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet268.d org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet288.d org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/TableCursor.d rakefile |
diffstat | 9 files changed, 29 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/base/src/java/lang/Thread.d Wed Aug 25 23:08:27 2010 +0200 +++ b/base/src/java/lang/Thread.d Wed Sep 15 16:42:28 2010 +0200 @@ -173,5 +173,12 @@ public static void yield(){ TThread.yield(); } + + public static void joinAll(){ + version (Tango) + tango.core.Thread.thread_joinAll(); + else + core.thread.thread_joinAll(); + } }
--- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet130a.d Wed Aug 25 23:08:27 2010 +0200 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet130a.d Wed Sep 15 16:42:28 2010 +0200 @@ -33,7 +33,7 @@ import java.lang.all; -import tango.core.Thread; +//import tango.core.Thread; import tango.io.Stdout; import tango.util.Convert; import tango.util.log.Trace; @@ -67,7 +67,7 @@ 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); - Thread.sleep(0.500); + Thread.sleep(500); } /* for (int i = 0; i < 100000; i++) {
--- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet133.d Wed Aug 25 23:08:27 2010 +0200 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet133.d Wed Sep 15 16:42:28 2010 +0200 @@ -51,7 +51,7 @@ import java.lang.all; // tango -import tango.core.Thread; +//import tango.core.Thread; import tango.io.device.File; import tango.text.Unicode; @@ -241,7 +241,7 @@ } public this(char[] o_name){ - this.name = o_name; + //this.name = o_name; super(&run); } };
--- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet142.d Wed Aug 25 23:08:27 2010 +0200 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet142.d Wed Sep 15 16:42:28 2010 +0200 @@ -30,7 +30,7 @@ import java.lang.all; -import tango.core.Thread; +//import tango.core.Thread; import tango.io.Stdout; void main(String[] args) { @@ -48,7 +48,7 @@ Thread thread = new Thread({ Event event; try { - Thread.sleep(300/1000.); + Thread.sleep(300); } catch (InterruptedException e) {} event = new Event(); event.type = SWT.MouseMove; @@ -56,13 +56,13 @@ event.y = pt.y; display.post(event); try { - Thread.sleep(300/1000.0); + Thread.sleep(300); } catch (InterruptedException e) {} event.type = SWT.MouseDown; event.button = 1; display.post(event); try { - Thread.sleep(300/1000.0); + Thread.sleep(300); } catch (InterruptedException e) {} event.type = SWT.MouseUp; display.post(event);
--- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet146.d Wed Aug 25 23:08:27 2010 +0200 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet146.d Wed Sep 15 16:42:28 2010 +0200 @@ -28,7 +28,7 @@ import java.lang.all; -import tango.core.Thread; +//import tango.core.Thread; import tango.text.Unicode; void main(String[] args) { @@ -58,12 +58,12 @@ event.character = ch; display.post(event); try { - Thread.sleep(10/1000.); + Thread.sleep(10); } catch (InterruptedException e) {} event.type = SWT.KeyUp; display.post(event); try { - Thread.sleep(100/1000.0); + Thread.sleep(100); } catch (InterruptedException e) {} if (shift) { event = new Event();
--- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet268.d Wed Aug 25 23:08:27 2010 +0200 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet268.d Wed Sep 15 16:42:28 2010 +0200 @@ -34,7 +34,7 @@ import tango.io.Stdout; import tango.util.Convert; -import tango.core.Thread; +//import tango.core.Thread; void main(String[] args) { Display display = new Display(); @@ -65,7 +65,7 @@ event.count = -2; display.post(event); try { - Thread.sleep(400/1000); + Thread.sleep(400); } catch (InterruptedException e) {} } Stdout("Thread done\n").flush();
--- a/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet288.d Wed Aug 25 23:08:27 2010 +0200 +++ b/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet288.d Wed Sep 15 16:42:28 2010 +0200 @@ -33,7 +33,7 @@ import tango.io.FilePath; import tango.io.model.IFile; -import tango.core.Thread; +//import tango.core.Thread; import tango.io.Stdout; import tango.util.Convert; import tango.core.Exception; @@ -88,7 +88,7 @@ } display.dispose (); } - thread_joinAll(); + Thread.joinAll(); } private static void loadAllImages(char[] directory, char[][] filenames) { @@ -167,8 +167,8 @@ int id = 0; this(int _id) { id = _id; - name = "Animation "~to!(char[])(ii); - isDaemon = true; + //name = "Animation "~to!(char[])(ii); + //isDaemon = true; super(&run); } void run() { @@ -190,7 +190,7 @@ int ms = imageDataArray[id][imageDataIndex].delayTime * 10; if (ms < 20) ms += 30; if (ms < 30) ms += 10; - Thread.sleep(0.001*ms); + Thread.sleep(1 * ms); } catch (ThreadException e) { }
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/TableCursor.d Wed Aug 25 23:08:27 2010 +0200 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/TableCursor.d Wed Sep 15 16:42:28 2010 +0200 @@ -208,7 +208,7 @@ public void handleEvent(Event event) { switch (event.type) { case SWT.Dispose : - dispose(event); + TableCursor.dispose(event); break; case SWT.FocusIn : case SWT.FocusOut :
--- a/rakefile Wed Aug 25 23:08:27 2010 +0200 +++ b/rakefile Wed Sep 15 16:42:28 2010 +0200 @@ -10,7 +10,8 @@ class String def to_path if isWindows - self.gsub( '/', '\\' ); + #self.gsub( '/', '\\' ); # don't know why this doesn't work + self else self end @@ -18,7 +19,7 @@ end def isWindows - Config::CONFIG['host_os'] =~ /mswin/ + Config::CONFIG['host_os'] =~ /mswin/ || Config::CONFIG['host_os'] =~ /mingw/ end ##########################################################################