37 BOOL _isSetOnMouseEntered;
38 BOOL _isSetOnMouseExited;
48 "ew-resize":
"e-resize",
49 "ns-resize":
"n-resize",
50 "nesw-resize":
"ne-resize",
51 "nwse-resize":
"nw-resize"
57 if (
self = [super init])
67 - (id)initWithImage:(
CPImage)image hotSpot:(CGPoint)hotSpot
71 return [
self initWithCSSString:"url(" + [_image filename] + ")" + hotSpot.x + " " + hotSpot.y + ", auto"];
79 - (id)initWithImage:(
CPImage)image foregroundColorHint:(
CPColor)foregroundColor backgroundColorHint:(
CPColor)backgroundColor hotSpot:(CGPoint)aHotSpot
86 [
self _setCursorCSS:@"none"];
94 + (void)setHiddenUntilMouseMoves:(BOOL)flag
127 [[
self class] _setCursorCSS:_cssString];
144 + (void)_setCursorCSS:(
CPString)aString
147 var platformWindows = [[
CPPlatformWindow visiblePlatformWindows] allObjects];
149 for (var i = 0, count = [platformWindows count]; i < count; i++)
150 platformWindows[i]._DOMBodyElement.style.cursor = aString;
157 var cursor =
cursors[cursorName];
159 if (typeof cursor ===
"undefined")
165 var themeResourcePath = [[[CPApp themeBlend] bundle] resourcePath],
168 cssString = [
CPString stringWithFormat:@"url(%@cursors/%@.%@), %@", themeResourcePath, cursorName, extension, aString];
182 cursor = [[
CPCursor alloc] initWithCSSString:cssString];
191 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"default" hasImage:NO];
196 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"crosshair" hasImage:NO];
201 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"text" hasImage:NO];
206 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"pointer" hasImage:NO];
211 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"nw-resize" hasImage:NO];
216 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"nwse-resize" hasImage:NO];
221 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"ne-resize" hasImage:NO];
226 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"nesw-resize" hasImage:NO];
231 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"sw-resize" hasImage:NO];
236 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"se-resize" hasImage:NO];
241 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"s-resize" hasImage:NO];
246 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"n-resize" hasImage:NO];
251 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"w-resize" hasImage:NO];
256 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"e-resize" hasImage:NO];
261 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"col-resize" hasImage:NO];
266 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"ew-resize" hasImage:NO];
271 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"row-resize" hasImage:NO];
276 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"ns-resize" hasImage:NO];
281 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"not-allowed" hasImage:NO];
286 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"copy" hasImage:YES];
291 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"alias" hasImage:YES];
296 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"context-menu" hasImage:YES];
301 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"move" hasImage:YES];
306 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"-moz-grabbing" hasImage:YES];
311 return [
CPCursor _systemCursorWithName:CPStringFromSelector(_cmd) cssString:@"auto" hasImage:YES];
320 if (
self = [super init])
321 _cssString = [coder decodeObjectForKey:@"CPCursorNameKey"];
328 [coder encodeObject:_cssString forKey:@"CPCursorNameKey"];
370 - (BOOL)isSetOnMouseEntered
372 return _isSetOnMouseEntered;
378 - (void)setOnMouseEntered:(BOOL)aValue
380 _isSetOnMouseEntered = aValue;
386 - (BOOL)isSetOnMouseExited
388 return _isSetOnMouseExited;
394 - (void)setOnMouseExited:(BOOL)aValue
396 _isSetOnMouseExited = aValue;