| 1 |
// |
| 2 |
// NSCursorAdditions.m |
| 3 |
// Alchemusica |
| 4 |
// |
| 5 |
// Created by Toshi Nagata on Sun Nov 21 2004. |
| 6 |
/* |
| 7 |
Copyright (c) 2004-2011 Toshi Nagata. All rights reserved. |
| 8 |
|
| 9 |
This program is free software; you can redistribute it and/or modify |
| 10 |
it under the terms of the GNU General Public License as published by |
| 11 |
the Free Software Foundation version 2 of the License. |
| 12 |
|
| 13 |
This program is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
*/ |
| 18 |
|
| 19 |
#import "NSCursorAdditions.h" |
| 20 |
|
| 21 |
static NSCursor *sHorizontalMoveCursor; |
| 22 |
static NSCursor *sVerticalMoveCursor; |
| 23 |
static NSCursor *sHorizontalMovePlusCursor; |
| 24 |
static NSCursor *sHorizontalMoveZoomCursor; |
| 25 |
static NSCursor *sVerticalMovePlusCursor; |
| 26 |
static NSCursor *sStretchCursor; |
| 27 |
static NSCursor *sMoveAroundCursor; |
| 28 |
static NSCursor *sLoupeCursor; |
| 29 |
static NSCursor *sPencilCursor; |
| 30 |
static NSCursor *sSpeakerCursor; |
| 31 |
|
| 32 |
@implementation NSCursor (MyCursorAddition) |
| 33 |
|
| 34 |
+ (NSCursor *)horizontalMoveCursor |
| 35 |
{ |
| 36 |
if (sHorizontalMoveCursor == nil) |
| 37 |
sHorizontalMoveCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"horizontal_move.png"] hotSpot: NSMakePoint(7, 7)]; |
| 38 |
return sHorizontalMoveCursor; |
| 39 |
} |
| 40 |
|
| 41 |
+ (NSCursor *)verticalMoveCursor |
| 42 |
{ |
| 43 |
if (sVerticalMoveCursor == nil) |
| 44 |
sVerticalMoveCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"vertical_move.png"] hotSpot: NSMakePoint(7, 7)]; |
| 45 |
return sVerticalMoveCursor; |
| 46 |
} |
| 47 |
|
| 48 |
+ (NSCursor *)horizontalMovePlusCursor |
| 49 |
{ |
| 50 |
if (sHorizontalMovePlusCursor == nil) |
| 51 |
sHorizontalMovePlusCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"horizontal_move_plus.png"] hotSpot: NSMakePoint(7, 7)]; |
| 52 |
return sHorizontalMovePlusCursor; |
| 53 |
} |
| 54 |
|
| 55 |
+ (NSCursor *)horizontalMoveZoomCursor |
| 56 |
{ |
| 57 |
if (sHorizontalMoveZoomCursor == nil) |
| 58 |
sHorizontalMoveZoomCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"horizontal_move_zoom.png"] hotSpot: NSMakePoint(7, 6)]; |
| 59 |
return sHorizontalMoveZoomCursor; |
| 60 |
} |
| 61 |
|
| 62 |
+ (NSCursor *)verticalMovePlusCursor |
| 63 |
{ |
| 64 |
if (sVerticalMovePlusCursor == nil) |
| 65 |
sVerticalMovePlusCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"vertical_move_plus.png"] hotSpot: NSMakePoint(7, 7)]; |
| 66 |
return sVerticalMovePlusCursor; |
| 67 |
} |
| 68 |
|
| 69 |
+ (NSCursor *)stretchCursor |
| 70 |
{ |
| 71 |
if (sStretchCursor == nil) |
| 72 |
sStretchCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"stretch.png"] hotSpot: NSMakePoint(3, 7)]; |
| 73 |
return sStretchCursor; |
| 74 |
} |
| 75 |
|
| 76 |
+ (NSCursor *)moveAroundCursor |
| 77 |
{ |
| 78 |
if (sMoveAroundCursor == nil) |
| 79 |
sMoveAroundCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"move_around.png"] hotSpot: NSMakePoint(7, 7)]; |
| 80 |
return sMoveAroundCursor; |
| 81 |
} |
| 82 |
|
| 83 |
+ (NSCursor *)loupeCursor |
| 84 |
{ |
| 85 |
if (sLoupeCursor == nil) |
| 86 |
sLoupeCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"loupe.png"] hotSpot: NSMakePoint(6, 6)]; |
| 87 |
return sLoupeCursor; |
| 88 |
} |
| 89 |
|
| 90 |
+ (NSCursor *)pencilCursor |
| 91 |
{ |
| 92 |
if (sPencilCursor == nil) |
| 93 |
sPencilCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"pencil_cursor.png"] hotSpot: NSMakePoint(4, 15)]; |
| 94 |
return sPencilCursor; |
| 95 |
} |
| 96 |
|
| 97 |
+ (NSCursor *)speakerCursor |
| 98 |
{ |
| 99 |
if (sSpeakerCursor == nil) |
| 100 |
sSpeakerCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"speaker_cursor.png"] hotSpot: NSMakePoint(8, 8)]; |
| 101 |
return sSpeakerCursor; |
| 102 |
} |
| 103 |
|
| 104 |
|
| 105 |
@end |