+ […]
+
+ provider = CGDataProviderCreateWithData(
+ NULL,
+ cursor->data,
+ cursor->width * cursor->height * 4,
+ NULL
+ );
+
+ image = CGImageCreate(
+ cursor->width, //width
+ cursor->height, //height
+ 8, //bitsPerComponent
+ 32, //bitsPerPixel
+ cursor->width * 4, //bytesPerRow
+ colorspace, //colorspace
+ kCGBitmapByteOrder32Little | kCGImageAlphaFirst, //bitmapInfo
+ provider, //provider
+ NULL, //decode
+ 0, //interpolate
+ kCGRenderingIntentDefault //intent
+ );
I still think this is an awkward amount of boilerplate that could be outsourced to a helper function - especially as you've now reminded me in patch 1/4 that drawRect: does essentially the same thing and could probably share that helper.
I'm still keen on NSCursor support for absolute pointing mode though, so I can experiment with doing a better job of cleaning it up as part v3 of that patch series. So: