comparison dwt/graphics/Resource.d @ 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 d3cfc7ee5c52
children 36f5cb12e1a2
comparison
equal deleted inserted replaced
173:97c2675aca38 174:f906dbcacee5
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2005 IBM Corporation and others. 2 * Copyright (c) 2000, 2005 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
10 *******************************************************************************/ 12 *******************************************************************************/
11 module dwt.graphics.Resource; 13 module dwt.graphics.Resource;
12 14
13 import dwt.DWT; 15 import dwt.DWT;
14 import dwt.graphics.Device; 16 import dwt.graphics.Device;
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 * Resources created by the application must be disposed. 20 * Resources created by the application must be disposed.
19 * <p> 21 * <p>
20 * IMPORTANT: This class is intended to be subclassed <em>only</em> 22 * IMPORTANT: This class is intended to be subclassed <em>only</em>
21 * within the DWT implementation. However, it has not been marked 23 * within the DWT implementation. However, it has not been marked
22 * final to allow those outside of the DWT development team to implement 24 * final to allow those outside of the DWT development team to implement
30 * implemented as subclasses of this class. 32 * implemented as subclasses of this class.
31 * </p> 33 * </p>
32 * 34 *
33 * @see #dispose 35 * @see #dispose
34 * @see #isDisposed 36 * @see #isDisposed
35 * 37 *
36 * @since 3.1 38 * @since 3.1
37 */ 39 */
38 public abstract class Resource { 40 public abstract class Resource {
39 41
40 /** 42 /**
41 * the device where this resource was created 43 * the device where this resource was created
42 */ 44 */
43 Device device; 45 Device device;
44 46
52 /** 54 /**
53 * Returns the <code>Device</code> where this resource was 55 * Returns the <code>Device</code> where this resource was
54 * created. 56 * created.
55 * 57 *
56 * @return <code>Device</code> the device of the receiver 58 * @return <code>Device</code> the device of the receiver
57 * 59 *
58 * @since 3.2 60 * @since 3.2
59 */ 61 */
60 public Device getDevice() { 62 public Device getDevice() {
61 Device device = this.device; 63 Device device = this.device;
62 if (device is null || isDisposed ()) DWT.error (DWT.ERROR_GRAPHIC_DISPOSED); 64 if (device is null || isDisposed ()) DWT.error (DWT.ERROR_GRAPHIC_DISPOSED);