Mercurial > projects > dwt-addons
comparison dwtx/draw2d/Cursors.d @ 103:2d6540440fe6
Replace static ctors with lazy init.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 03 Aug 2008 17:01:51 +0200 |
parents | 95307ad235d9 |
children |
comparison
equal
deleted
inserted
replaced
102:0de61c6f08ca | 103:2d6540440fe6 |
---|---|
83 } | 83 } |
84 | 84 |
85 /** | 85 /** |
86 * @see DWT#CURSOR_ARROW | 86 * @see DWT#CURSOR_ARROW |
87 */ | 87 */ |
88 public static const Cursor ARROW; | 88 private static Cursor ARROW_; |
89 public static Cursor ARROW(){ | |
90 if( !initStaticCtor_done ) initStaticCtor(); | |
91 return ARROW_; | |
92 } | |
93 | |
89 /** | 94 /** |
90 * @see DWT#CURSOR_SIZEN | 95 * @see DWT#CURSOR_SIZEN |
91 */ | 96 */ |
92 public static const Cursor SIZEN; | 97 private static Cursor SIZEN_; |
98 public static Cursor SIZEN(){ | |
99 if( !initStaticCtor_done ) initStaticCtor(); | |
100 return SIZEN_; | |
101 } | |
102 | |
93 /** | 103 /** |
94 * @see DWT#CURSOR_SIZENE | 104 * @see DWT#CURSOR_SIZENE |
95 */ | 105 */ |
96 public static const Cursor SIZENE; | 106 private static Cursor SIZENE_; |
107 public static Cursor SIZENE(){ | |
108 if( !initStaticCtor_done ) initStaticCtor(); | |
109 return SIZENE_; | |
110 } | |
111 | |
97 /** | 112 /** |
98 * @see DWT#CURSOR_SIZEE | 113 * @see DWT#CURSOR_SIZEE |
99 */ | 114 */ |
100 public static const Cursor SIZEE; | 115 private static Cursor SIZEE_; |
116 public static Cursor SIZEE(){ | |
117 if( !initStaticCtor_done ) initStaticCtor(); | |
118 return SIZEE_; | |
119 } | |
120 | |
101 /** | 121 /** |
102 * @see DWT#CURSOR_SIZESE | 122 * @see DWT#CURSOR_SIZESE |
103 */ | 123 */ |
104 public static const Cursor SIZESE; | 124 private static Cursor SIZESE_; |
125 public static Cursor SIZESE(){ | |
126 if( !initStaticCtor_done ) initStaticCtor(); | |
127 return SIZESE_; | |
128 } | |
129 | |
105 /** | 130 /** |
106 * @see DWT#CURSOR_SIZES | 131 * @see DWT#CURSOR_SIZES |
107 */ | 132 */ |
108 public static const Cursor SIZES; | 133 private static Cursor SIZES_; |
134 public static Cursor SIZES(){ | |
135 if( !initStaticCtor_done ) initStaticCtor(); | |
136 return SIZES_; | |
137 } | |
138 | |
109 /** | 139 /** |
110 * @see DWT#CURSOR_SIZESW | 140 * @see DWT#CURSOR_SIZESW |
111 */ | 141 */ |
112 public static const Cursor SIZESW; | 142 private static Cursor SIZESW_; |
143 public static Cursor SIZESW(){ | |
144 if( !initStaticCtor_done ) initStaticCtor(); | |
145 return SIZESW_; | |
146 } | |
147 | |
113 /** | 148 /** |
114 * @see DWT#CURSOR_SIZEW | 149 * @see DWT#CURSOR_SIZEW |
115 */ | 150 */ |
116 public static const Cursor SIZEW; | 151 private static Cursor SIZEW_; |
152 public static Cursor SIZEW(){ | |
153 if( !initStaticCtor_done ) initStaticCtor(); | |
154 return SIZEW_; | |
155 } | |
156 | |
117 /** | 157 /** |
118 * @see DWT#CURSOR_SIZENW | 158 * @see DWT#CURSOR_SIZENW |
119 */ | 159 */ |
120 public static const Cursor SIZENW; | 160 private static Cursor SIZENW_; |
161 public static Cursor SIZENW(){ | |
162 if( !initStaticCtor_done ) initStaticCtor(); | |
163 return SIZENW_; | |
164 } | |
165 | |
121 /** | 166 /** |
122 * @see DWT#CURSOR_APPSTARTING | 167 * @see DWT#CURSOR_APPSTARTING |
123 */ | 168 */ |
124 public static const Cursor APPSTARTING; | 169 private static Cursor APPSTARTING_; |
170 public static Cursor APPSTARTING(){ | |
171 if( !initStaticCtor_done ) initStaticCtor(); | |
172 return APPSTARTING_; | |
173 } | |
174 | |
125 /** | 175 /** |
126 * @see DWT#CURSOR_CROSS | 176 * @see DWT#CURSOR_CROSS |
127 */ | 177 */ |
128 public static const Cursor CROSS; | 178 private static Cursor CROSS_; |
179 public static Cursor CROSS(){ | |
180 if( !initStaticCtor_done ) initStaticCtor(); | |
181 return CROSS_; | |
182 } | |
183 | |
129 /** | 184 /** |
130 * @see DWT#CURSOR_HAND | 185 * @see DWT#CURSOR_HAND |
131 */ | 186 */ |
132 public static const Cursor HAND; | 187 private static Cursor HAND_; |
188 public static Cursor HAND(){ | |
189 if( !initStaticCtor_done ) initStaticCtor(); | |
190 return HAND_; | |
191 } | |
192 | |
133 /** | 193 /** |
134 * @see DWT#CURSOR_HELP | 194 * @see DWT#CURSOR_HELP |
135 */ | 195 */ |
136 public static const Cursor HELP; | 196 private static Cursor HELP_; |
197 public static Cursor HELP(){ | |
198 if( !initStaticCtor_done ) initStaticCtor(); | |
199 return HELP_; | |
200 } | |
201 | |
137 /** | 202 /** |
138 * @see DWT#CURSOR_IBEAM | 203 * @see DWT#CURSOR_IBEAM |
139 */ | 204 */ |
140 public static const Cursor IBEAM; | 205 private static Cursor IBEAM_; |
206 public static Cursor IBEAM(){ | |
207 if( !initStaticCtor_done ) initStaticCtor(); | |
208 return IBEAM_; | |
209 } | |
210 | |
141 /** | 211 /** |
142 * @see DWT#CURSOR_NO | 212 * @see DWT#CURSOR_NO |
143 */ | 213 */ |
144 public static const Cursor NO; | 214 private static Cursor NO_; |
215 public static Cursor NO(){ | |
216 if( !initStaticCtor_done ) initStaticCtor(); | |
217 return NO_; | |
218 } | |
219 | |
145 /** | 220 /** |
146 * @see DWT#CURSOR_SIZEALL | 221 * @see DWT#CURSOR_SIZEALL |
147 */ | 222 */ |
148 public static const Cursor SIZEALL; | 223 private static Cursor SIZEALL_; |
224 public static Cursor SIZEALL(){ | |
225 if( !initStaticCtor_done ) initStaticCtor(); | |
226 return SIZEALL_; | |
227 } | |
228 | |
149 /** | 229 /** |
150 * @see DWT#CURSOR_SIZENESW | 230 * @see DWT#CURSOR_SIZENESW |
151 */ | 231 */ |
152 public static const Cursor SIZENESW; | 232 private static Cursor SIZENESW_; |
233 public static Cursor SIZENESW(){ | |
234 if( !initStaticCtor_done ) initStaticCtor(); | |
235 return SIZENESW_; | |
236 } | |
237 | |
153 /** | 238 /** |
154 * @see DWT#CURSOR_SIZENWSE | 239 * @see DWT#CURSOR_SIZENWSE |
155 */ | 240 */ |
156 public static const Cursor SIZENWSE; | 241 private static Cursor SIZENWSE_; |
242 public static Cursor SIZENWSE(){ | |
243 if( !initStaticCtor_done ) initStaticCtor(); | |
244 return SIZENWSE_; | |
245 } | |
246 | |
157 /** | 247 /** |
158 * @see DWT#CURSOR_SIZEWE | 248 * @see DWT#CURSOR_SIZEWE |
159 */ | 249 */ |
160 public static const Cursor SIZEWE; | 250 private static Cursor SIZEWE_; |
251 public static Cursor SIZEWE(){ | |
252 if( !initStaticCtor_done ) initStaticCtor(); | |
253 return SIZEWE_; | |
254 } | |
255 | |
161 /** | 256 /** |
162 * @see DWT#CURSOR_SIZENS | 257 * @see DWT#CURSOR_SIZENS |
163 */ | 258 */ |
164 public static const Cursor SIZENS; | 259 private static Cursor SIZENS_; |
260 public static Cursor SIZENS(){ | |
261 if( !initStaticCtor_done ) initStaticCtor(); | |
262 return SIZENS_; | |
263 } | |
264 | |
165 /** | 265 /** |
166 * @see DWT#CURSOR_UPARROW | 266 * @see DWT#CURSOR_UPARROW |
167 */ | 267 */ |
168 public static const Cursor UPARROW; | 268 private static Cursor UPARROW_; |
269 public static Cursor UPARROW(){ | |
270 if( !initStaticCtor_done ) initStaticCtor(); | |
271 return UPARROW_; | |
272 } | |
273 | |
169 /** | 274 /** |
170 * @see DWT#CURSOR_WAIT | 275 * @see DWT#CURSOR_WAIT |
171 */ | 276 */ |
172 public static const Cursor WAIT; | 277 private static Cursor WAIT_; |
173 | 278 public static Cursor WAIT(){ |
174 static this() { | 279 if( !initStaticCtor_done ) initStaticCtor(); |
175 ARROW = new Cursor(null, DWT.CURSOR_ARROW); | 280 return WAIT_; |
176 SIZEN = new Cursor(null, DWT.CURSOR_SIZEN); | 281 } |
177 SIZENE = new Cursor(null, DWT.CURSOR_SIZENE); | 282 |
178 SIZEE = new Cursor(null, DWT.CURSOR_SIZEE); | 283 private static bool initStaticCtor_done = false; |
179 SIZESE = new Cursor(null, DWT.CURSOR_SIZESE); | 284 private static void initStaticCtor() { |
180 SIZES = new Cursor(null, DWT.CURSOR_SIZES); | 285 synchronized(Cursor.classinfo){ |
181 SIZESW = new Cursor(null, DWT.CURSOR_SIZESW); | 286 if(!initStaticCtor_done){ |
182 SIZEW = new Cursor(null, DWT.CURSOR_SIZEW); | 287 ARROW_ = new Cursor(null, DWT.CURSOR_ARROW); |
183 SIZENW = new Cursor(null, DWT.CURSOR_SIZENW); | 288 SIZEN_ = new Cursor(null, DWT.CURSOR_SIZEN); |
184 SIZENS = new Cursor(null, DWT.CURSOR_SIZENS); | 289 SIZENE_ = new Cursor(null, DWT.CURSOR_SIZENE); |
185 SIZEWE = new Cursor(null, DWT.CURSOR_SIZEWE); | 290 SIZEE_ = new Cursor(null, DWT.CURSOR_SIZEE); |
186 APPSTARTING = new Cursor(null, DWT.CURSOR_APPSTARTING); | 291 SIZESE_ = new Cursor(null, DWT.CURSOR_SIZESE); |
187 CROSS = new Cursor(null, DWT.CURSOR_CROSS); | 292 SIZES_ = new Cursor(null, DWT.CURSOR_SIZES); |
188 HAND = new Cursor(null, DWT.CURSOR_HAND); | 293 SIZESW_ = new Cursor(null, DWT.CURSOR_SIZESW); |
189 HELP = new Cursor(null, DWT.CURSOR_HELP); | 294 SIZEW_ = new Cursor(null, DWT.CURSOR_SIZEW); |
190 IBEAM = new Cursor(null, DWT.CURSOR_IBEAM); | 295 SIZENW_ = new Cursor(null, DWT.CURSOR_SIZENW); |
191 NO = new Cursor(null, DWT.CURSOR_NO); | 296 SIZENS_ = new Cursor(null, DWT.CURSOR_SIZENS); |
192 SIZEALL = new Cursor(null, DWT.CURSOR_SIZEALL); | 297 SIZEWE_ = new Cursor(null, DWT.CURSOR_SIZEWE); |
193 SIZENESW = new Cursor(null, DWT.CURSOR_SIZENESW); | 298 APPSTARTING_ = new Cursor(null, DWT.CURSOR_APPSTARTING); |
194 SIZENWSE = new Cursor(null, DWT.CURSOR_SIZENWSE); | 299 CROSS_ = new Cursor(null, DWT.CURSOR_CROSS); |
195 UPARROW = new Cursor(null, DWT.CURSOR_UPARROW); | 300 HAND_ = new Cursor(null, DWT.CURSOR_HAND); |
196 WAIT = new Cursor(null, DWT.CURSOR_WAIT); | 301 HELP_ = new Cursor(null, DWT.CURSOR_HELP); |
197 } | 302 IBEAM_ = new Cursor(null, DWT.CURSOR_IBEAM); |
198 | 303 NO_ = new Cursor(null, DWT.CURSOR_NO); |
199 } | 304 SIZEALL_ = new Cursor(null, DWT.CURSOR_SIZEALL); |
305 SIZENESW_ = new Cursor(null, DWT.CURSOR_SIZENESW); | |
306 SIZENWSE_ = new Cursor(null, DWT.CURSOR_SIZENWSE); | |
307 UPARROW_ = new Cursor(null, DWT.CURSOR_UPARROW); | |
308 WAIT_ = new Cursor(null, DWT.CURSOR_WAIT); | |
309 initStaticCtor_done = true; | |
310 } | |
311 } | |
312 } | |
313 | |
314 } |