Mercurial > projects > dwt-mac
diff dwt/graphics/Cursor.d @ 36:db5a898b2119
Fixed a lot of compile errors
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 07 Oct 2008 12:56:18 +0200 |
parents | 7d135fe0caf2 |
children | d8635bb48c7c |
line wrap: on
line diff
--- a/dwt/graphics/Cursor.d Sun Sep 14 23:32:29 2008 +0200 +++ b/dwt/graphics/Cursor.d Tue Oct 07 12:56:18 2008 +0200 @@ -61,6 +61,8 @@ public final class Cursor : Resource { + alias Resource.init_ init_; + /** * the handle to the OS cursor resource * (Warning: This field is platform dependent) @@ -151,7 +153,7 @@ } handle.retain(); handle.setOnMouseEntered(true); - init(); + init_(); } /** @@ -229,10 +231,11 @@ } } createNSCursor(hotspotX, hotspotY, data, source.width, source.height); - init(); + init_(); } void createNSCursor(int hotspotX, int hotspotY, byte[] buffer, int width, int height) { + ubyte** dummy; NSImage nsImage = cast(NSImage)(new NSImage()).alloc(); NSBitmapImageRep nsImageRep = cast(NSBitmapImageRep)(new NSBitmapImageRep()).alloc(); handle = cast(NSCursor)(new NSCursor()).alloc(); @@ -240,10 +243,10 @@ size.width = width; size.height = height; nsImage = nsImage.initWithSize(size); - nsImageRep = nsImageRep.initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_(0, cast(NSInteger) width, cast(NSInteger) height, - 8, 4, true, false, new NSString(OS.NSDeviceRGBColorSpace()), - OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, cast(NSInteger) (width * 4, 32)); - OS.memmove(nsImageRep.bitmapData(), buffer, buffer.length); + nsImageRep = nsImageRep.initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_(dummy, cast(NSInteger) width, cast(NSInteger) height, + 8, 4, true, false, OS.NSDeviceRGBColorSpace, + NSAlphaFirstBitmapFormat | NSAlphaNonpremultipliedBitmapFormat, cast(NSInteger) (width * 4), 32); + OS.memmove(cast(void*) nsImageRep.bitmapData(), buffer.ptr, buffer.length); nsImage.addRepresentation(nsImageRep); NSPoint point = NSPoint(); point.x = hotspotX; @@ -338,7 +341,7 @@ } } createNSCursor(hotspotX, hotspotY, data, source.width, source.height); - init(); + init_(); } void destroy() { @@ -363,7 +366,7 @@ return device is cursor.device && handle is cursor.handle; } -alias opEequals equals; +alias opEquals equals; /** * Returns an integer hash code for the receiver. Any two @@ -375,8 +378,8 @@ * * @see #equals */ -public hast_t toHash () { - return handle !is null ? handle.id_ : 0; +public hash_t toHash () { + return handle !is null ? cast(hash_t) handle.id_ : 0; } alias toHash hashCode;