Changeset 174:f906dbcacee5
- Timestamp:
- 03/02/08 17:39:01
(6 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Minor changes to be more compatible to dwt-linux, formatting in toString, Display.DEBUG=true
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r117 |
r174 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | module dwt.graphics.Device; |
|---|
| 14 | | |
|---|
| 15 | | /++ //PORTING_TYPE |
|---|
| 16 | | import dwt.internal.win32.OS; |
|---|
| 17 | | class Device{ |
|---|
| 18 | | static Device getDevice(); |
|---|
| 19 | | void new_Object (Object object); |
|---|
| 20 | | bool tracking; |
|---|
| 21 | | public bool isDisposed () ; |
|---|
| 22 | | void dispose_Object (Object object) ; |
|---|
| 23 | | float computePoints(LOGFONT* logFont, HFONT hFont); |
|---|
| 24 | | int computePixels(float height) ; |
|---|
| 25 | | public HPALETTE hPalette; |
|---|
| 26 | | int [] colorRefCount; |
|---|
| 27 | | |
|---|
| 28 | | } |
|---|
| 29 | | ++/ |
|---|
| 30 | 14 | |
|---|
| 31 | 15 | import dwt.DWT; |
|---|
| … | … | |
| 61 | 45 | |
|---|
| 62 | 46 | /* Debugging */ |
|---|
| 63 | | public static bool DEBUG; |
|---|
| | 47 | public static bool DEBUG = true; |
|---|
| 64 | 48 | bool debug_; |
|---|
| 65 | 49 | bool tracking; |
|---|
| r48 |
r174 |
|
| 86 | 86 | * @return a string representation of the event |
|---|
| 87 | 87 | */ |
|---|
| 88 | | override public char[] toString () { |
|---|
| | 88 | public override char[] toString () { |
|---|
| 89 | 89 | 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$ |
|---|
| 90 | 90 | } |
|---|
| r16 |
r174 |
|
| 1 | | /******************************************************************************* |
|---|
| | 1 | /******************************************************************************* |
|---|
| 2 | 2 | * Copyright (c) 2000, 2005 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| … | … | |
| 153 | 153 | } else { |
|---|
| 154 | 154 | for (int i = 0; i < colors.length; i++) { |
|---|
| 155 | | if (colors[i] ==/*eq*/ rgb ) return i; |
|---|
| | 155 | if (colors[i].opEquals(rgb)) return i; |
|---|
| 156 | 156 | } |
|---|
| 157 | 157 | /* The RGB did not exist in the palette */ |
|---|
| r48 |
r174 |
|
| 1 | | /******************************************************************************* |
|---|
| | 1 | /******************************************************************************* |
|---|
| 2 | 2 | * Copyright (c) 2000, 2005 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| … | … | |
| 106 | 106 | */ |
|---|
| 107 | 107 | override public char[] toString () { |
|---|
| 108 | | return Format( "Point {}, {}}", x, y );; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
|---|
| | 108 | return Format( "Point {{{}, {}}", x, y );; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
|---|
| 109 | 109 | } |
|---|
| 110 | 110 | |
|---|
| r4 |
r174 |
|
| 1 | | /******************************************************************************* |
|---|
| | 1 | /******************************************************************************* |
|---|
| 2 | 2 | * Copyright (c) 2000, 2005 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| … | … | |
| 315 | 315 | */ |
|---|
| 316 | 316 | public override char[] toString () { |
|---|
| 317 | | return Format( "Rectangle {}, {}, {}, {}}", x, y, width, height ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ |
|---|
| | 317 | return Format( "Rectangle {{{}, {}, {}, {}}", x, y, width, height ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ |
|---|
| 318 | 318 | } |
|---|
| 319 | 319 | |
|---|
| r14 |
r174 |
|
| 1 | | /******************************************************************************* |
|---|
| | 1 | /******************************************************************************* |
|---|
| 2 | 2 | * Copyright (c) 2000, 2005 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| … | … | |
| 8 | 8 | * Contributors: |
|---|
| 9 | 9 | * IBM Corporation - initial API and implementation |
|---|
| | 10 | * Port to the D programming language: |
|---|
| | 11 | * Frank Benoit <benoit@tionex.de> |
|---|
| 10 | 12 | *******************************************************************************/ |
|---|
| 11 | 13 | module dwt.graphics.Resource; |
|---|
| … | … | |
| 15 | 17 | |
|---|
| 16 | 18 | /** |
|---|
| 17 | | * This class is the abstract superclass of all graphics resource objects. |
|---|
| | 19 | * This class is the abstract superclass of all graphics resource objects. |
|---|
| 18 | 20 | * Resources created by the application must be disposed. |
|---|
| 19 | 21 | * <p> |
|---|
| … | … | |
| 33 | 35 | * @see #dispose |
|---|
| 34 | 36 | * @see #isDisposed |
|---|
| 35 | | * |
|---|
| | 37 | * |
|---|
| 36 | 38 | * @since 3.1 |
|---|
| 37 | 39 | */ |
|---|
| 38 | 40 | public abstract class Resource { |
|---|
| 39 | | |
|---|
| | 41 | |
|---|
| 40 | 42 | /** |
|---|
| 41 | 43 | * the device where this resource was created |
|---|
| … | … | |
| 55 | 57 | * |
|---|
| 56 | 58 | * @return <code>Device</code> the device of the receiver |
|---|
| 57 | | * |
|---|
| | 59 | * |
|---|
| 58 | 60 | * @since 3.2 |
|---|
| 59 | 61 | */ |
|---|