[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: "Temporary code" inside swt.graphics.Device ... not so temporary?

The "temporary code" is here to stay.  Are you automatically translating the
code?

"verec" <verec@xxxxxxx> wrote in message
news:da6pta$g5b$1@xxxxxxxxxxxxxxxxxxx
> SWT 3.1 (3138) as part of the newly released Eclipse 3.1
> still reads, at the top of Device.java
>
> /*
> * TEMPORARY CODE. When a graphics object is
> * created and the device parameter is null,
> * the current Display is used. This presents
> * a problem because SWT graphics does not
> * reference classes in SWT widgets. The correct
> * fix is to remove this feature. Unfortunately,
> * too many application programs rely on this
> * feature.
> *
> * This code will be removed in the future.
> */
> protected static Device CurrentDevice;
> protected static Runnable DeviceFinder;
> static {
> try {
> Class.forName ("org.eclipse.swt.widgets.Display");
> } catch (Throwable e) {}
> }
>
> /*
> * TEMPORARY CODE.
> */
> static synchronized Device getDevice () {
> if (DeviceFinder != null) DeviceFinder.run();
> Device device = CurrentDevice;
> CurrentDevice = null;
> return device;
> }
>
> The "problem" is that when the comment mentions "graphics object"
> it isn't really talking about the GC class, but about everything
> that could even remotely have to deal with a Device, such as:
>
> getDevice() : Device - org.eclipse.swt.graphics.Device
> Image(Device, String) - org.eclipse.swt.graphics.Image
> Font(Device, FontData[]) - org.eclipse.swt.graphics.Font
> carbon_new(Device, int) : Cursor - org.eclipse.swt.graphics.Cursor
> Image(Device, ImageData, ImageData) - org.eclipse.swt.graphics.Image
> carbon_new(Device, int, short, short, short) : Font -
> org.eclipse.swt.graphics.Font
> Image(Device, int, int) - org.eclipse.swt.graphics.Image
> Cursor(Device, int) - org.eclipse.swt.graphics.Cursor
> Cursor(Device, ImageData, int, int) - org.eclipse.swt.graphics.Cursor
> Image(Device, ImageData) - org.eclipse.swt.graphics.Image
> Image(Device, InputStream) - org.eclipse.swt.graphics.Image
> init(Device, int, int, int) : void - org.eclipse.swt.graphics.Color
> GC(Drawable, int) - org.eclipse.swt.graphics.GC
> Font(Device, String, int, int) - org.eclipse.swt.graphics.Font
> Pattern(Device, Image) - org.eclipse.swt.graphics.Pattern
> TextLayout(Device) - org.eclipse.swt.graphics.TextLayout
> Pattern(Device, float, float, float, float, Color, Color) -
> org.eclipse.swt.graphics.Pattern
> Path(Device) - org.eclipse.swt.graphics.Path
> carbon_new(Device, float[]) : Color - org.eclipse.swt.graphics.Color
> Image(Device, Image, int) - org.eclipse.swt.graphics.Image
> Transform(Device, float, float, float, float, float, float) -
> org.eclipse.swt.graphics.Transform
> Image(Device, Rectangle) - org.eclipse.swt.graphics.Image
> Region(Device) - org.eclipse.swt.graphics.Region
> Font(Device, FontData) - org.eclipse.swt.graphics.Font
> carbon_new(Device, int, int, int) : Image - org.eclipse.swt.graphics.Image
> Cursor(Device, ImageData, ImageData, int, int) -
> org.eclipse.swt.graphics.Cursor
>
> So... Is a deprecation of some sort still in the plan, or is this
"temporary"
> code here to stay?
>
> (I do care because I'm translating this to C++ ...)
> -- 
> Do your users a favor: give them Style: http://www.uiwithstyle.org
>