Mercurial > projects > dwt-mac
comparison dwt/dwthelper/System.d @ 61:c74ba20de292
Fix: The application responds to events now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 23 Dec 2008 00:35:24 +0100 |
parents | db5a898b2119 |
children | 38807a925e24 |
comparison
equal
deleted
inserted
replaced
60:62202ce0039f | 61:c74ba20de292 |
---|---|
3 */ | 3 */ |
4 module dwt.dwthelper.System; | 4 module dwt.dwthelper.System; |
5 | 5 |
6 import tango.core.Exception; | 6 import tango.core.Exception; |
7 import tango.io.Stdout; | 7 import tango.io.Stdout; |
8 import tango.io.Print; | 8 |
9 version (LDC) | |
10 { | |
11 import tango.io.stream.Format; | |
12 alias FormatOutput Print; | |
13 } | |
14 | |
15 else | |
16 import tango.io.Print; | |
17 | |
9 import tango.stdc.stdlib : exit; | 18 import tango.stdc.stdlib : exit; |
10 import tango.time.Clock; | 19 import tango.time.Clock; |
11 | 20 |
12 template SimpleType(T) { | 21 template SimpleType(T) { |
13 debug{ | 22 debug{ |
87 dest[destPos..(len+destPos)] = src[srcPos..(len+srcPos)]; | 96 dest[destPos..(len+destPos)] = src[srcPos..(len+srcPos)]; |
88 } | 97 } |
89 } | 98 } |
90 } | 99 } |
91 | 100 |
92 struct OutS | 101 struct Out |
93 { | 102 { |
103 | |
94 static Print!(char) delegate(char[] fmt,...) println; | 104 static Print!(char) delegate(char[] fmt,...) println; |
95 static Print!(char) delegate(char[] fmt,...) print; | 105 static Print!(char) delegate(char[] fmt,...) print; |
106 | |
96 static this () | 107 static this () |
97 { | 108 { |
98 println = &Stdout.formatln; | 109 println = &Stdout.formatln; |
99 print = &Stdout.format; | 110 print = &Stdout.format; |
100 } | 111 } |
102 | 113 |
103 struct Err | 114 struct Err |
104 { | 115 { |
105 static Print!(char) delegate(char[] fmt,...) println; | 116 static Print!(char) delegate(char[] fmt,...) println; |
106 static Print!(char) delegate(char[] fmt,...) print; | 117 static Print!(char) delegate(char[] fmt,...) print; |
118 | |
107 static this () | 119 static this () |
108 { | 120 { |
109 println = &Stderr.formatln; | 121 println = &Stderr.formatln; |
110 print = &Stderr.format; | 122 print = &Stderr.format; |
111 } | 123 } |
163 case "os.name": return "windows"; | 175 case "os.name": return "windows"; |
164 default: return null; | 176 default: return null; |
165 } | 177 } |
166 } | 178 } |
167 | 179 |
168 static OutS Out; | 180 static Out out_; |
169 static Err err; | 181 static Err err; |
170 } | 182 } |