Mercurial > projects > dwt2
annotate org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/ImageLoaderEvent.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 | 6bf2837c50fe |
children |
rev | line source |
---|---|
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 /******************************************************************************* |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 * All rights reserved. This program and the accompanying materials |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
5 * which accompanies this distribution, and is available at |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
6 * http://www.eclipse.org/legal/epl-v10.html |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
7 * |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
8 * Contributors: |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
9 * IBM Corporation - initial API and implementation |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
10 * Port to the D programming language: |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
11 * Frank Benoit <benoit@tionex.de> |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
12 *******************************************************************************/ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
13 module org.eclipse.swt.graphics.ImageLoaderEvent; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
14 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
15 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
16 public import org.eclipse.swt.internal.SWTEventObject; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
17 public import org.eclipse.swt.graphics.ImageLoader; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
18 public import org.eclipse.swt.graphics.ImageData; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
19 import java.lang.all; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
20 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
21 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
22 /** |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
23 * Instances of this class are sent as a result of the incremental |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
24 * loading of image data. |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
25 * <p> |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
26 * <b>Notes:</b> |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
27 * </p><ul> |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
28 * <li>The number of events which will be sent when loading images |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
29 * is not constant. It varies by image type, and for JPEG images it |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
30 * varies from image to image.</li> |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
31 * <li>For image sources which contain multiple images, the |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
32 * <code>endOfImage</code> flag in the event will be set to true |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
33 * after each individual image is loaded.</li> |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
34 * </ul> |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
35 * |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
36 * @see ImageLoader |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
37 * @see ImageLoaderListener |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
38 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
39 */ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
40 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
41 public class ImageLoaderEvent : SWTEventObject { |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
42 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
43 /** |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
44 * if the <code>endOfImage</code> flag is false, then this is a |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
45 * partially complete copy of the current <code>ImageData</code>, |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
46 * otherwise this is a completely loaded <code>ImageData</code> |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
47 */ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
48 public ImageData imageData; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
49 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
50 /** |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
51 * the zero-based count of image data increments -- this is |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
52 * equivalent to the number of events that have been generated |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
53 * while loading a particular image |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
54 */ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
55 public int incrementCount; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
56 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
57 /** |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
58 * If this flag is true, then the current image data has been |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
59 * completely loaded, otherwise the image data is only partially |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
60 * loaded, and further ImageLoader events will occur unless an |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
61 * exception is thrown |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
62 */ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
63 public bool endOfImage; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
64 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
65 //static final long serialVersionUID = 3257284738325558065L; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
66 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 /** |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
68 * Constructs a new instance of this class given the event source and |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
69 * the values to store in its fields. |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
70 * |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 * @param source the ImageLoader that was loading when the event occurred |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 * @param imageData the image data for the event |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
73 * @param incrementCount the image data increment for the event |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
74 * @param endOfImage the end of image flag for the event |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
75 */ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
76 public this(ImageLoader source, ImageData imageData, int incrementCount, bool endOfImage) { |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
77 super(source); |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
78 this.imageData = imageData; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
79 this.incrementCount = incrementCount; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
80 this.endOfImage = endOfImage; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
81 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
82 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
83 /** |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
84 * Returns a string containing a concise, human-readable |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
85 * description of the receiver. |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
86 * |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
87 * @return a string representation of the event |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
88 */ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
89 public override String toString () { |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
4
diff
changeset
|
90 return Format( "ImageLoaderEvent {{source={} imageData={} incrementCount={} endOfImage={}}", source, imageData, incrementCount, endOfImage); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
91 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
92 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
93 } |