Mercurial > projects > dwt-win
diff dwt/graphics/Region.d @ 213:36f5cb12e1a2
Update to SWT 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 17 May 2008 17:34:28 +0200 |
parents | ab60f3309436 |
children | fd9c62a2998e |
line wrap: on
line diff
--- a/dwt/graphics/Region.d Mon May 05 00:12:38 2008 +0200 +++ b/dwt/graphics/Region.d Sat May 17 17:34:28 2008 +0200 @@ -38,6 +38,7 @@ */ public final class Region : Resource { + alias Resource.init_ init_; /** * the OS resource for the region @@ -82,12 +83,10 @@ * @since 3.0 */ public this (Device device) { - if (device is null) device = Device.getDevice(); - if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); - this.device = device; + super(device); handle = OS.CreateRectRgn (0, 0, 0, 0); if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES); - if (device.tracking) device.new_Object(this); + init_(); } /** @@ -97,7 +96,7 @@ * @param handle the handle for the result */ this(Device device, HRGN handle) { - this.device = device; + super(device); this.handle = handle; } @@ -233,18 +232,9 @@ return contains(pt.x, pt.y); } -/** - * Disposes of the operating system resources associated with - * the region. Applications must dispose of all regions which - * they allocate. - */ -override public void dispose () { - if (handle is null) return; - if (device.isDisposed()) return; +void destroy () { OS.DeleteObject(handle); handle = null; - if (device.tracking) device.dispose_Object(this); - device = null; } /**