comparison org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/AnimatedProgress.d @ 120:536e43f63c81

Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661 ===D2=== * added [Try]Immutable/Const/Shared templates to work with differenses in D1/D2 instead of version statements used these templates to work with strict type storage rules of dmd-2.053 * com.ibm.icu now also compilable with D2, but not tested yet * small fixes Snippet288 - shared data is in TLS ===Phobos=== * fixed critical bugs in Phobos implemention completely incorrect segfault prone fromStringz (Linux's port ruthless killer) terrible, incorrect StringBuffer realization (StyledText killer) * fixed small bugs as well Snippet72 - misprint in the snippet * implemented missed functionality for Phobos ByteArrayOutputStream implemented (image loading available) formatting correctly works for all DWT's cases As a result, folowing snippets now works with Phobos (Snippet### - what is fixed): Snippet24, 42, 111, 115, 130, 235, 276 - bad string formatting Snippet48, 282 - crash on image loading Snippet163, 189, 211, 213, 217, 218, 222 - crash on copy/cut in StyledText Snippet244 - hang-up ===Tango=== * few changes for the latest Tango trunc-r5661 * few small performance improvments ===General=== * implMissing-s for only one version changed to implMissingInTango/InPhobos * incorrect calls to Format in toString-s fixed * fixed loading \uXXXX characters in ResourceBundle * added good UTF-8 support for StyledText, TextLayout (Win32) and friends UTF functions revised and tested. It is now in java.nonstandard.*Utf modules StyledText and TextLayout (Win32) modules revised for UTF-8 support * removed small diferences in most identical files in *.swt.* folders *.swt.internal.image, *.swt.events and *.swt.custom are identical in Win32/Linux32 now 179 of 576 (~31%) files in *.swt.* folders are fully identical * Win32: snippets now have right subsystem, pretty icons and native system style controls * small fixes in snippets Snippet44 - it's not Snippet44 Snippet212 - functions work with different images and offsets arrays Win32: Snippet282 - crash on close if the button has an image Snippet293 - setGrayed is commented and others Win32: As a result, folowing snippets now works Snippet68 - color doesn't change Snippet163, 189, 211, 213, 217, 218, 222 - UTF-8 issues (see above) Snippet193 - no tabel headers
author Denis Shelomovskij <verylonglogin.reg@gmail.com>
date Sat, 09 Jul 2011 15:50:20 +0300
parents fb3aa8075988
children
comparison
equal deleted inserted replaced
119:d00e8db0a568 120:536e43f63c81
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language: 10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de> 11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/ 12 *******************************************************************************/
13 module org.eclipse.swt.custom.AnimatedProgress; 13 module org.eclipse.swt.custom.AnimatedProgress;
14
15 import java.lang.all;
16 14
17 15
18 import org.eclipse.swt.SWT; 16 import org.eclipse.swt.SWT;
19 import org.eclipse.swt.SWTException; 17 import org.eclipse.swt.SWTException;
20 import org.eclipse.swt.events.ControlAdapter; 18 import org.eclipse.swt.events.ControlAdapter;
28 import org.eclipse.swt.graphics.Point; 26 import org.eclipse.swt.graphics.Point;
29 import org.eclipse.swt.graphics.Rectangle; 27 import org.eclipse.swt.graphics.Rectangle;
30 import org.eclipse.swt.widgets.Canvas; 28 import org.eclipse.swt.widgets.Canvas;
31 import org.eclipse.swt.widgets.Composite; 29 import org.eclipse.swt.widgets.Composite;
32 import org.eclipse.swt.widgets.Display; 30 import org.eclipse.swt.widgets.Display;
31 import java.lang.Runnable;
33 32
34 /** 33 /**
35 * A control for showing progress feedback for a long running operation. 34 * A control for showing progress feedback for a long running operation.
36 * 35 *
37 * @deprecated As of Eclipse 2.1, use ProgressBar with the style SWT.INDETERMINATE 36 * @deprecated As of Eclipse 2.1, use ProgressBar with the style SWT.INDETERMINATE
119 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 118 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
120 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 119 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
121 * </ul> 120 * </ul>
122 */ 121 */
123 public void clear(){ 122 public void clear(){
124 synchronized { 123 synchronized {
125 checkWidget(); 124 checkWidget();
126 if (active) stop(); 125 if (active) stop();
127 showStripes = false; 126 showStripes = false;
128 redraw(); 127 redraw();
129 } 128 }
130 } 129 }
131 public override Point computeSize(int wHint, int hHint, bool changed) { 130 public override Point computeSize(int wHint, int hHint, bool changed) {
132 checkWidget(); 131 checkWidget();
133 Point size = null; 132 Point size = null;
210 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 209 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
211 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 210 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
212 * </ul> 211 * </ul>
213 */ 212 */
214 public void start() { 213 public void start() {
215 synchronized { 214 synchronized {
216 checkWidget(); 215 checkWidget();
217 if (active) return; 216 if (active) return;
218 217
219 active = true; 218 active = true;
220 showStripes = true; 219 showStripes = true;
221 220
222 Display display = getDisplay(); 221 Display display = getDisplay();
223 Runnable [] timer = new Runnable [1]; 222 Runnable [] timer = new Runnable [1];
224 223
225 timer [0] = new class( display, timer ) Runnable { 224 timer [0] = new class( display, timer ) Runnable {
226 Display disp; 225 Display disp;
227 Runnable [] runs; 226 Runnable [] runs;
228 this( Display disp, Runnable[] runs ){ 227 this( Display disp, Runnable[] runs ){
229 this.disp = disp; 228 this.disp = disp;
230 this.runs = runs; 229 this.runs = runs;
231 } 230 }
232 public void run () { 231 public void run () {
233 if (!active) return; 232 if (!active) return;
234 GC gc = new GC(this.outer); 233 GC gc = new GC(this.outer);
235 paintStripes(gc); 234 paintStripes(gc);
236 gc.dispose(); 235 gc.dispose();
237 disp.timerExec (SLEEP, runs [0]); 236 disp.timerExec (SLEEP, runs [0]);
238 } 237 }
239 }; 238 };
240 display.timerExec (SLEEP, timer [0]); 239 display.timerExec (SLEEP, timer [0]);
241 } 240 }
242 } 241 }
243 /** 242 /**
244 * Stop the animation. Freeze the presentation at its current appearance. 243 * Stop the animation. Freeze the presentation at its current appearance.
245 */ 244 */
246 public void stop() { 245 public void stop() {
247 synchronized { 246 synchronized {
248 //checkWidget(); 247 //checkWidget();
249 active = false; 248 active = false;
250 } 249 }
251 } 250 }
252 } 251 }