# HG changeset patch # User Frank Benoit # Date 1204497541 -3600 # Node ID f906dbcacee544c016a57a62f1d8521e4c33cfaf # Parent 97c2675aca381c5aa6c6551d0d6d2303602ccf5a Minor changes to be more compatible to dwt-linux, formatting in toString, Display.DEBUG=true diff -r 97c2675aca38 -r f906dbcacee5 dwt/graphics/Device.d --- a/dwt/graphics/Device.d Sun Mar 02 23:12:38 2008 +0100 +++ b/dwt/graphics/Device.d Sun Mar 02 23:39:01 2008 +0100 @@ -12,22 +12,6 @@ *******************************************************************************/ module dwt.graphics.Device; -/++ //PORTING_TYPE -import dwt.internal.win32.OS; -class Device{ - static Device getDevice(); - void new_Object (Object object); - bool tracking; - public bool isDisposed () ; - void dispose_Object (Object object) ; - float computePoints(LOGFONT* logFont, HFONT hFont); - int computePixels(float height) ; - public HPALETTE hPalette; - int [] colorRefCount; - -} -++/ - import dwt.DWT; import dwt.DWTException; import dwt.internal.gdip.Gdip; @@ -60,7 +44,7 @@ } /* Debugging */ - public static bool DEBUG; + public static bool DEBUG = true; bool debug_; bool tracking; Exception [] errors; diff -r 97c2675aca38 -r f906dbcacee5 dwt/graphics/ImageLoaderEvent.d --- a/dwt/graphics/ImageLoaderEvent.d Sun Mar 02 23:12:38 2008 +0100 +++ b/dwt/graphics/ImageLoaderEvent.d Sun Mar 02 23:39:01 2008 +0100 @@ -85,7 +85,7 @@ * * @return a string representation of the event */ -override public char[] toString () { +public override char[] toString () { 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$ } diff -r 97c2675aca38 -r f906dbcacee5 dwt/graphics/PaletteData.d --- a/dwt/graphics/PaletteData.d Sun Mar 02 23:12:38 2008 +0100 +++ b/dwt/graphics/PaletteData.d Sun Mar 02 23:39:01 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -152,7 +152,7 @@ return pixel; } else { for (int i = 0; i < colors.length; i++) { - if (colors[i] ==/*eq*/ rgb ) return i; + if (colors[i].opEquals(rgb)) return i; } /* The RGB did not exist in the palette */ DWT.error(DWT.ERROR_INVALID_ARGUMENT); diff -r 97c2675aca38 -r f906dbcacee5 dwt/graphics/Point.d --- a/dwt/graphics/Point.d Sun Mar 02 23:12:38 2008 +0100 +++ b/dwt/graphics/Point.d Sun Mar 02 23:39:01 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -105,7 +105,7 @@ * @return a string representation of the point */ override public char[] toString () { - return Format( "Point {}, {}}", x, y );; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return Format( "Point {{{}, {}}", x, y );; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } diff -r 97c2675aca38 -r f906dbcacee5 dwt/graphics/Rectangle.d --- a/dwt/graphics/Rectangle.d Sun Mar 02 23:12:38 2008 +0100 +++ b/dwt/graphics/Rectangle.d Sun Mar 02 23:39:01 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -314,7 +314,7 @@ * @return a string representation of the rectangle */ public override char[] toString () { - return Format( "Rectangle {}, {}, {}, {}}", x, y, width, height ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + return Format( "Rectangle {{{}, {}, {}, {}}", x, y, width, height ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ } /** diff -r 97c2675aca38 -r f906dbcacee5 dwt/graphics/Resource.d --- a/dwt/graphics/Resource.d Sun Mar 02 23:12:38 2008 +0100 +++ b/dwt/graphics/Resource.d Sun Mar 02 23:39:01 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -7,6 +7,8 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Port to the D programming language: + * Frank Benoit *******************************************************************************/ module dwt.graphics.Resource; @@ -14,7 +16,7 @@ import dwt.graphics.Device; /** - * This class is the abstract superclass of all graphics resource objects. + * This class is the abstract superclass of all graphics resource objects. * Resources created by the application must be disposed. *

* IMPORTANT: This class is intended to be subclassed only @@ -32,11 +34,11 @@ * * @see #dispose * @see #isDisposed - * + * * @since 3.1 */ public abstract class Resource { - + /** * the device where this resource was created */ @@ -54,7 +56,7 @@ * created. * * @return Device the device of the receiver - * + * * @since 3.2 */ public Device getDevice() {