changeset 174:f906dbcacee5

Minor changes to be more compatible to dwt-linux, formatting in toString, Display.DEBUG=true
author Frank Benoit <benoit@tionex.de>
date Sun, 02 Mar 2008 23:39:01 +0100
parents 97c2675aca38
children 0a96e5a30470
files dwt/graphics/Device.d dwt/graphics/ImageLoaderEvent.d dwt/graphics/PaletteData.d dwt/graphics/Point.d dwt/graphics/Rectangle.d dwt/graphics/Resource.d
diffstat 6 files changed, 15 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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$
 }
 
--- 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);
--- 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$
 }
 
 }
--- 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$
 }
 
 /**
--- 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 <benoit@tionex.de>
  *******************************************************************************/
 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.
  * <p>
  * IMPORTANT: This class is intended to be subclassed <em>only</em>
@@ -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 <code>Device</code> the device of the receiver
- * 
+ *
  * @since 3.2
  */
 public Device getDevice() {