Changeset 213:36f5cb12e1a2 for dwt/graphics/Region.d
- Timestamp:
- 05/17/08 11:34:28 (8 months ago)
- Files:
-
- dwt/graphics/Region.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/graphics/Region.d
r212 r213 39 39 40 40 public final class Region : Resource { 41 alias Resource.init_ init_; 41 42 42 43 /** … … 83 84 */ 84 85 public this (Device device) { 85 if (device is null) device = Device.getDevice(); 86 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 87 this.device = device; 86 super(device); 88 87 handle = OS.CreateRectRgn (0, 0, 0, 0); 89 88 if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES); 90 i f (device.tracking) device.new_Object(this);89 init_(); 91 90 } 92 91 … … 98 97 */ 99 98 this(Device device, HRGN handle) { 100 this.device = device;99 super(device); 101 100 this.handle = handle; 102 101 } … … 234 233 } 235 234 236 /** 237 * Disposes of the operating system resources associated with 238 * the region. Applications must dispose of all regions which 239 * they allocate. 240 */ 241 override public void dispose () { 242 if (handle is null) return; 243 if (device.isDisposed()) return; 235 void destroy () { 244 236 OS.DeleteObject(handle); 245 237 handle = null; 246 if (device.tracking) device.dispose_Object(this);247 device = null;248 238 } 249 239
