Revision: 5886
http://skim-app.svn.sourceforge.net/skim-app/?rev=5886&view=rev
Author: hofman
Date: 2009-10-15 19:52:47 +0000 (Thu, 15 Oct 2009)
Log Message:
-----------
draw camera cursor in code
Modified Paths:
--------------
trunk/NSCursor_SKExtensions.m
trunk/NSImage_SKExtensions.h
trunk/NSImage_SKExtensions.m
trunk/Skim.xcodeproj/project.pbxproj
Removed Paths:
-------------
trunk/Images/CameraCursor.tiff
Deleted: trunk/Images/CameraCursor.tiff
===================================================================
(Binary files differ)
Modified: trunk/NSCursor_SKExtensions.m
===================================================================
--- trunk/NSCursor_SKExtensions.m 2009-10-15 15:27:48 UTC (rev 5885)
+++ trunk/NSCursor_SKExtensions.m 2009-10-15 19:52:47 UTC (rev 5886)
@@ -99,7 +99,7 @@
+ (NSCursor *)cameraCursor {
static NSCursor *cameraCursor = nil;
if (nil == cameraCursor) {
- NSImage *cursorImage = [[[NSImage imageNamed:@"CameraCursor"] copy]
autorelease];
+ NSImage *cursorImage = [[[NSImage imageNamed:SKImageNameCameraCursor]
copy] autorelease];
cameraCursor = [[NSCursor alloc] initWithImage:cursorImage
hotSpot:NSMakePoint(8.0, 8.0)];
}
return cameraCursor;
Modified: trunk/NSImage_SKExtensions.h
===================================================================
--- trunk/NSImage_SKExtensions.h 2009-10-15 15:27:48 UTC (rev 5885)
+++ trunk/NSImage_SKExtensions.h 2009-10-15 19:52:47 UTC (rev 5886)
@@ -118,6 +118,7 @@
extern NSString *SKImageNameResizeLeftUpCursor;
extern NSString *SKImageNameZoomInCursor;
extern NSString *SKImageNameZoomOutCursor;
+extern NSString *SKImageNameCameraCursor;
@interface NSImage (SKExtensions)
Modified: trunk/NSImage_SKExtensions.m
===================================================================
--- trunk/NSImage_SKExtensions.m 2009-10-15 15:27:48 UTC (rev 5885)
+++ trunk/NSImage_SKExtensions.m 2009-10-15 19:52:47 UTC (rev 5886)
@@ -121,6 +121,7 @@
NSString *SKImageNameResizeLeftUpCursor = @"ResizeLeftUpCursor";
NSString *SKImageNameZoomInCursor = @"ZoomInCursor";
NSString *SKImageNameZoomOutCursor = @"ZoomOutCursor";
+NSString *SKImageNameCameraCursor = @"CameraCursor";
- (NSImage *)copyWithMenuBadge {
NSBezierPath *arrowPath = [NSBezierPath bezierPath];
@@ -1537,6 +1538,7 @@
static NSImage *resizeRightUpCursorImage = nil;
static NSImage *zoomInCursorImage = nil;
static NSImage *zoomOutCursorImage = nil;
+ static NSImage *cameraCursorImage = nil;
if (resizeLeftDownCursorImage)
return;
@@ -1864,6 +1866,30 @@
[NSGraphicsContext restoreGraphicsState];
[zoomOutCursorImage unlockFocus];
[zoomOutCursorImage setName:SKImageNameZoomOutCursor];
+
+ cameraCursorImage = [[NSImage alloc] initWithSize:size];
+ [cameraCursorImage lockFocus];
+ [[NSGraphicsContext currentContext]
setImageInterpolation:NSImageInterpolationNone];
+ [NSGraphicsContext saveGraphicsState];
+ [[NSColor whiteColor] set];
+ [[NSBezierPath bezierPathWithRect:NSMakeRect(0, 2, 16, 11)] fill];
+ [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(3.7, 6.7, 8.6, 8.6)]
fill];
+ [NSGraphicsContext restoreGraphicsState];
+ [NSGraphicsContext saveGraphicsState];
+ [[NSColor blackColor] set];
+ [[NSBezierPath bezierPathWithRect:NSMakeRect(1, 3, 14, 9)] fill];
+ [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(5, 8, 6, 6)] fill];
+ [NSGraphicsContext restoreGraphicsState];
+ [NSGraphicsContext saveGraphicsState];
+ [[NSColor whiteColor] set];
+ [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(4.3, 4.3, 7.4, 7.4)]
stroke];
+ path = [NSBezierPath bezierPath];
+ [path appendBezierPathWithArcWithCenter:NSMakePoint(8, 8) radius:1.8
startAngle:45 endAngle:225];
+ [path closePath];
+ [path fill];
+ [NSGraphicsContext restoreGraphicsState];
+ [cameraCursorImage unlockFocus];
+ [zoomOutCursorImage setName:SKImageNameCameraCursor];
}
+ (void)makeImages {
Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj 2009-10-15 15:27:48 UTC (rev
5885)
+++ trunk/Skim.xcodeproj/project.pbxproj 2009-10-15 19:52:47 UTC (rev
5886)
@@ -103,7 +103,6 @@
CE3401E00E01378A00A7FFE6 /* NSAttributedString_SKExtensions.m
in Sources */ = {isa = PBXBuildFile; fileRef = CE3401DF0E01378A00A7FFE6 /*
NSAttributedString_SKExtensions.m */; };
CE3401E60E01388700A7FFE6 /* NSNumber_SKExtensions.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CE3401E50E01388700A7FFE6 /*
NSNumber_SKExtensions.m */; };
CE34FFA80DFF58FB00A7FFE6 /* NSEvent_SKExtensions.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CE34FFA70DFF58FB00A7FFE6 /*
NSEvent_SKExtensions.m */; };
- CE380A7B0B834E6200A1B779 /* CameraCursor.tiff in Resources */ =
{isa = PBXBuildFile; fileRef = CE380A7A0B834E6100A1B779 /* CameraCursor.tiff
*/; };
CE38ECD30B8093B200A1B779 /* NSString_SKExtensions.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CE38ECD20B8093B200A1B779 /*
NSString_SKExtensions.m */; };
CE3A3D2C0B78C0A0006B64D3 /* SKNPDFAnnotationNote_SKExtensions.m
in Sources */ = {isa = PBXBuildFile; fileRef = CE3A3D2B0B78C0A0006B64D3 /*
SKNPDFAnnotationNote_SKExtensions.m */; };
CE3A41580B790C56006B64D3 /* BDSKDragImageView.m in Sources */ =
{isa = PBXBuildFile; fileRef = CE3A41570B790C56006B64D3 /* BDSKDragImageView.m
*/; };
@@ -661,7 +660,6 @@
CE3401E50E01388700A7FFE6 /* NSNumber_SKExtensions.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= NSNumber_SKExtensions.m; sourceTree = "<group>"; };
CE34FFA60DFF58FB00A7FFE6 /* NSEvent_SKExtensions.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
NSEvent_SKExtensions.h; sourceTree = "<group>"; };
CE34FFA70DFF58FB00A7FFE6 /* NSEvent_SKExtensions.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= NSEvent_SKExtensions.m; sourceTree = "<group>"; };
- CE380A7A0B834E6100A1B779 /* CameraCursor.tiff */ = {isa =
PBXFileReference; lastKnownFileType = image.tiff; path = CameraCursor.tiff;
sourceTree = "<group>"; };
CE38ECD10B8093B200A1B779 /* NSString_SKExtensions.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
NSString_SKExtensions.h; sourceTree = "<group>"; };
CE38ECD20B8093B200A1B779 /* NSString_SKExtensions.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= NSString_SKExtensions.m; sourceTree = "<group>"; };
CE3A3D2A0B78C0A0006B64D3 /* SKNPDFAnnotationNote_SKExtensions.h
*/ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.h; path = SKNPDFAnnotationNote_SKExtensions.h; sourceTree =
"<group>"; };
@@ -1490,7 +1488,6 @@
CEAA68EA0C71242F006BD633 /* Resume.tiff */,
CE6DC9930D699F21003A072F /* TransitionMask.jpg
*/,
CEB735A10C4A8CD6000350F9 /*
TransitionShading.tiff */,
- CE380A7A0B834E6100A1B779 /* CameraCursor.tiff
*/,
);
path = Images;
sourceTree = "<group>";
@@ -1828,7 +1825,6 @@
45A3BD390B4F097D002B297F /*
InitialUserDefaults.plist in Resources */,
8D15AC2C0486D014006FF6A4 /* Credits.rtf in
Resources */,
8D15AC2F0486D014006FF6A4 /* InfoPlist.strings
in Resources */,
- CE380A7B0B834E6200A1B779 /* CameraCursor.tiff
in Resources */,
CE07158B0B8A3D6500733CC8 /* NoteDocument.icns
in Resources */,
CE07158C0B8A3D6500733CC8 /* PDFDocument.icns in
Resources */,
CE7469180B7F40B700CBF969 /* Skim.icns in
Resources */,
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit