From 7819ce2dfa7ad66716b9ea93e87657cc6d93ea74 Mon Sep 17 00:00:00 2001 From: "lordpixel@mac.com" Date: Fri, 11 Dec 2009 23:17:27 +0100 Subject: [PATCH] Bug 489734 - Implement cursor values "alias", "context-menu", "copy", "not-allowed" and "no-drop" on Mac Os 10.6. r=josh --HG-- extra : rebase_source : da270898f5250ffeaf0d5f1225bd81bd63d1dafd --- widget/src/cocoa/nsCursorManager.mm | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/widget/src/cocoa/nsCursorManager.mm b/widget/src/cocoa/nsCursorManager.mm index a39c9009e74..db4707471bb 100644 --- a/widget/src/cocoa/nsCursorManager.mm +++ b/widget/src/cocoa/nsCursorManager.mm @@ -107,6 +107,7 @@ static NSArray* sSpinCursorFrames = nil; switch(aCursor) { + SEL cursorSelector; case eCursor_standard: return [nsMacCursor cursorWithCursor: [NSCursor arrowCursor]]; case eCursor_wait: @@ -123,12 +124,20 @@ static NSArray* sSpinCursorFrames = nil; case eCursor_help: return [nsMacCursor cursorWithImageNamed: @"help" hotSpot: NSMakePoint(1,1)]; case eCursor_copy: - return [nsMacCursor cursorWithCursor: [NSCursor arrowCursor]]; //XXX needs real implementation + cursorSelector = @selector(dragCopyCursor); + return [nsMacCursor cursorWithCursor: [NSCursor respondsToSelector: cursorSelector] ? + [NSCursor performSelector: cursorSelector] : + [NSCursor arrowCursor]]; case eCursor_alias: - return [nsMacCursor cursorWithCursor: [NSCursor arrowCursor]]; //XXX needs real implementation + cursorSelector = @selector(dragLinkCursor); + return [nsMacCursor cursorWithCursor: [NSCursor respondsToSelector: cursorSelector] ? + [NSCursor performSelector: cursorSelector] : + [NSCursor arrowCursor]]; case eCursor_context_menu: - return [nsMacCursor cursorWithCursor: [NSCursor arrowCursor]]; //XXX needs real implementation - + cursorSelector = @selector(contextualMenuCursor); + return [nsMacCursor cursorWithCursor: [NSCursor respondsToSelector: cursorSelector] ? + [NSCursor performSelector: cursorSelector] : + [NSCursor arrowCursor]]; case eCursor_cell: return [nsMacCursor cursorWithCursor: [NSCursor crosshairCursor]]; case eCursor_grab: @@ -145,8 +154,10 @@ static NSArray* sSpinCursorFrames = nil; return [nsMacCursor cursorWithCursor: [NSCursor openHandCursor]];; case eCursor_not_allowed: case eCursor_no_drop: - return [nsMacCursor cursorWithCursor: [NSCursor arrowCursor]]; //XXX needs real implementation - + cursorSelector = @selector(operationNotAllowedCursor); + return [nsMacCursor cursorWithCursor: [NSCursor respondsToSelector: cursorSelector] ? + [NSCursor performSelector: cursorSelector] : + [NSCursor arrowCursor]]; // Resize Cursors: //North case eCursor_n_resize: