Revision: 2585
http://skim-app.svn.sourceforge.net/skim-app/?rev=2585&view=rev
Author: hofman
Date: 2007-07-30 05:14:10 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
Add some corner resize cursors. Use resize cursors for edges of selection.
Modified Paths:
--------------
trunk/NSCursor_SKExtensions.h
trunk/NSCursor_SKExtensions.m
trunk/SKApplicationController.m
trunk/SKPDFView.m
trunk/Skim.xcodeproj/project.pbxproj
Added Paths:
-----------
trunk/Images/ResizeLeftDownCursor.tiff
trunk/Images/ResizeLeftUpCursor.tiff
trunk/Images/ResizeRightDownCursor.tiff
trunk/Images/ResizeRightUpCursor.tiff
Added: trunk/Images/ResizeLeftDownCursor.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/Images/ResizeLeftDownCursor.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Images/ResizeLeftUpCursor.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/Images/ResizeLeftUpCursor.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Images/ResizeRightDownCursor.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/Images/ResizeRightDownCursor.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Images/ResizeRightUpCursor.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/Images/ResizeRightUpCursor.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/NSCursor_SKExtensions.h
===================================================================
--- trunk/NSCursor_SKExtensions.h 2007-07-29 14:38:53 UTC (rev 2584)
+++ trunk/NSCursor_SKExtensions.h 2007-07-30 12:14:10 UTC (rev 2585)
@@ -43,6 +43,10 @@
+ (NSCursor *)zoomInCursor;
+ (NSCursor *)zoomOutCursor;
++ (NSCursor *)resizeLeftUpCursor;
++ (NSCursor *)resizeLeftDownCursor;
++ (NSCursor *)resizeRightUpCursor;
++ (NSCursor *)resizeRightDownCursor;
+ (NSCursor *)cameraCursor;
@end
Modified: trunk/NSCursor_SKExtensions.m
===================================================================
--- trunk/NSCursor_SKExtensions.m 2007-07-29 14:38:53 UTC (rev 2584)
+++ trunk/NSCursor_SKExtensions.m 2007-07-30 12:14:10 UTC (rev 2585)
@@ -59,6 +59,42 @@
return zoomOutCursor;
}
++ (NSCursor *)resizeLeftUpCursor {
+ static NSCursor *resizeLeftUpCursor = nil;
+ if (nil == resizeLeftUpCursor) {
+ NSImage *cursorImage = [[[NSImage imageNamed:@"ResizeLeftUpCursor"]
copy] autorelease];
+ resizeLeftUpCursor = [[NSCursor alloc] initWithImage:cursorImage
hotSpot:NSMakePoint(8.0, 8.0)];
+ }
+ return resizeLeftUpCursor;
+}
+
++ (NSCursor *)resizeLeftDownCursor {
+ static NSCursor *resizeLeftDownCursor = nil;
+ if (nil == resizeLeftDownCursor) {
+ NSImage *cursorImage = [[[NSImage imageNamed:@"ResizeLeftDownCursor"]
copy] autorelease];
+ resizeLeftDownCursor = [[NSCursor alloc] initWithImage:cursorImage
hotSpot:NSMakePoint(8.0, 8.0)];
+ }
+ return resizeLeftDownCursor;
+}
+
++ (NSCursor *)resizeRightUpCursor {
+ static NSCursor *resizeRightUpCursor = nil;
+ if (nil == resizeRightUpCursor) {
+ NSImage *cursorImage = [[[NSImage imageNamed:@"ResizeRightUpCursor"]
copy] autorelease];
+ resizeRightUpCursor = [[NSCursor alloc] initWithImage:cursorImage
hotSpot:NSMakePoint(8.0, 8.0)];
+ }
+ return resizeRightUpCursor;
+}
+
++ (NSCursor *)resizeRightDownCursor {
+ static NSCursor *resizeRightDownCursor = nil;
+ if (nil == resizeRightDownCursor) {
+ NSImage *cursorImage = [[[NSImage imageNamed:@"ResizeRightDownCursor"]
copy] autorelease];
+ resizeRightDownCursor = [[NSCursor alloc] initWithImage:cursorImage
hotSpot:NSMakePoint(8.0, 8.0)];
+ }
+ return resizeRightDownCursor;
+}
+
+ (NSCursor *)cameraCursor {
NSCursor *cameraCursor = nil;
Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m 2007-07-29 14:38:53 UTC (rev 2584)
+++ trunk/SKApplicationController.m 2007-07-30 12:14:10 UTC (rev 2585)
@@ -61,7 +61,8 @@
}
+ (void)setupDefaults{
-
+ NSLog(NSStringFromPoint([[NSCursor resizeLeftRightCursor] hotSpot]));
+ NSLog(NSStringFromPoint([[NSCursor resizeUpDownCursor] hotSpot]));
NSString *userDefaultsValuesPath;
NSDictionary *userDefaultsValuesDict;
NSDictionary *initialValuesDict;
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2007-07-29 14:38:53 UTC (rev 2584)
+++ trunk/SKPDFView.m 2007-07-30 12:14:10 UTC (rev 2585)
@@ -3457,12 +3457,27 @@
float margin = 4.0 / [self scaleFactor];
PDFPage *page = [self pageForPoint:p nearest:NO];
p = [self convertPoint:p toPage:page];
- if (NSPointInRect(p, NSInsetRect(selectionRect, -margin,
-margin)) == NO)
+ if (NSIsEmptyRect(selectionRect) || NSPointInRect(p,
NSInsetRect(selectionRect, -margin, -margin)) == NO) {
cursor = [NSCursor crosshairCursor];
- else if (NSPointInRect(p, NSInsetRect(selectionRect,
margin, margin)))
+ } else if (p.x > NSMaxX(selectionRect) - margin) {
+ if (p.y > NSMaxY(selectionRect) - margin)
+ cursor = [NSCursor resizeRightUpCursor];
+ else if (p.y < NSMinY(selectionRect) + margin)
+ cursor = [NSCursor resizeRightDownCursor];
+ else
+ cursor = [NSCursor resizeLeftRightCursor];
+ } else if (p.x < NSMinX(selectionRect) + margin) {
+ if (p.y > NSMaxY(selectionRect) - margin)
+ cursor = [NSCursor resizeLeftUpCursor];
+ else if (p.y < NSMinY(selectionRect) + margin)
+ cursor = [NSCursor resizeLeftDownCursor];
+ else
+ cursor = [NSCursor resizeLeftRightCursor];
+ } else if (p.y > NSMaxY(selectionRect) - margin || p.y <
NSMinY(selectionRect) + margin) {
+ cursor = [NSCursor resizeUpDownCursor];
+ } else {
cursor = [NSCursor openHandCursor];
- else
- cursor = [NSCursor arrowCursor];
+ }
}
break;
case SKMagnifyToolMode:
Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj 2007-07-29 14:38:53 UTC (rev
2584)
+++ trunk/Skim.xcodeproj/project.pbxproj 2007-07-30 12:14:10 UTC (rev
2585)
@@ -68,6 +68,10 @@
CE1E2B290BDAB6180011D9DD /* SKPDFSynchronizer.m in Sources */ =
{isa = PBXBuildFile; fileRef = CE1E2B270BDAB6180011D9DD /* SKPDFSynchronizer.m
*/; };
CE1E301D0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CE1E301B0BDB9D5C0011D9DD /*
NSScanner_SKExtensions.m */; };
CE1E30290BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m in
Sources */ = {isa = PBXBuildFile; fileRef = CE1E30270BDB9D8E0011D9DD /*
NSCharacterSet_SKExtensions.m */; };
+ CE2082E30C5E09DC009D3EFB /* ResizeLeftDownCursor.tiff in
Resources */ = {isa = PBXBuildFile; fileRef = CE2082DF0C5E09DC009D3EFB /*
ResizeLeftDownCursor.tiff */; };
+ CE2082E40C5E09DC009D3EFB /* ResizeLeftUpCursor.tiff in
Resources */ = {isa = PBXBuildFile; fileRef = CE2082E00C5E09DC009D3EFB /*
ResizeLeftUpCursor.tiff */; };
+ CE2082E50C5E09DC009D3EFB /* ResizeRightDownCursor.tiff in
Resources */ = {isa = PBXBuildFile; fileRef = CE2082E10C5E09DC009D3EFB /*
ResizeRightDownCursor.tiff */; };
+ CE2082E60C5E09DC009D3EFB /* ResizeRightUpCursor.tiff in
Resources */ = {isa = PBXBuildFile; fileRef = CE2082E20C5E09DC009D3EFB /*
ResizeRightUpCursor.tiff */; };
CE2BD83E0BD4132B00A5F4DB /* Sparkle.framework in Frameworks */
= {isa = PBXBuildFile; fileRef = CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework
*/; };
CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */ =
{isa = PBXBuildFile; fileRef = CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework
*/; };
CE2DE4920B85D48F00D0DA12 /* SKThumbnail.m in Sources */ = {isa
= PBXBuildFile; fileRef = CE2DE4910B85D48F00D0DA12 /* SKThumbnail.m */; };
@@ -361,6 +365,10 @@
CE1E301B0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m */ = {isa
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc;
path = NSScanner_SKExtensions.m; sourceTree = "<group>"; };
CE1E30260BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = NSCharacterSet_SKExtensions.h; sourceTree = "<group>"; };
CE1E30270BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.objc; path = NSCharacterSet_SKExtensions.m; sourceTree =
"<group>"; };
+ CE2082DF0C5E09DC009D3EFB /* ResizeLeftDownCursor.tiff */ = {isa
= PBXFileReference; lastKnownFileType = image.tiff; name =
ResizeLeftDownCursor.tiff; path = Images/ResizeLeftDownCursor.tiff; sourceTree
= "<group>"; };
+ CE2082E00C5E09DC009D3EFB /* ResizeLeftUpCursor.tiff */ = {isa =
PBXFileReference; lastKnownFileType = image.tiff; name =
ResizeLeftUpCursor.tiff; path = Images/ResizeLeftUpCursor.tiff; sourceTree =
"<group>"; };
+ CE2082E10C5E09DC009D3EFB /* ResizeRightDownCursor.tiff */ =
{isa = PBXFileReference; lastKnownFileType = image.tiff; name =
ResizeRightDownCursor.tiff; path = Images/ResizeRightDownCursor.tiff;
sourceTree = "<group>"; };
+ CE2082E20C5E09DC009D3EFB /* ResizeRightUpCursor.tiff */ = {isa
= PBXFileReference; lastKnownFileType = image.tiff; name =
ResizeRightUpCursor.tiff; path = Images/ResizeRightUpCursor.tiff; sourceTree =
"<group>"; };
CE2BD8170BD4127A00A5F4DB /* Sparkle.xcodeproj */ = {isa =
PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name =
Sparkle.xcodeproj; path = vendorsrc/andymatuschak/Sparkle/Sparkle.xcodeproj;
sourceTree = "<group>"; };
CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; path =
Sparkle.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CE2DE4900B85D48F00D0DA12 /* SKThumbnail.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
SKThumbnail.h; sourceTree = "<group>"; };
@@ -962,7 +970,6 @@
CE4373B30BB5440E00A56987 /* PSDocument.icns */,
CE4D88D70C3AE52F002C20CB /* DVIDocument.icns */,
CE0715890B8A3D6300733CC8 /* NoteDocument.icns
*/,
- CE380A7A0B834E6100A1B779 /* CameraCursor.tiff
*/,
CE7C5D180BD8086C0011315D /*
ToolbarLineNote.tiff */,
CE4190C20B94963A00ECF819 /*
ToolbarCircleNote.tiff */,
CEAFFD7A0C40ED5400C3ECBB /* ToolbarColors.tiff
*/,
@@ -992,6 +999,11 @@
CE5478C70B33456300F8AFB6 /*
ToolbarZoomToFit.tiff */,
CEB7359A0C4A8C1B000350F9 /* TransitionMask.jpg
*/,
CEB735A10C4A8CD6000350F9 /*
TransitionShading.tiff */,
+ CE380A7A0B834E6100A1B779 /* CameraCursor.tiff
*/,
+ CE2082DF0C5E09DC009D3EFB /*
ResizeLeftDownCursor.tiff */,
+ CE2082E00C5E09DC009D3EFB /*
ResizeLeftUpCursor.tiff */,
+ CE2082E10C5E09DC009D3EFB /*
ResizeRightDownCursor.tiff */,
+ CE2082E20C5E09DC009D3EFB /*
ResizeRightUpCursor.tiff */,
CE7467540B7F321100CBF969 /* zoomInCursor.tiff
*/,
CE7467550B7F321A00CBF969 /* zoomOutCursor.tiff
*/,
);
@@ -1201,6 +1213,10 @@
CEAFFD9D0C40F2A800C3ECBB /* ToolbarLines.tiff
in Resources */,
CEB7359C0C4A8C1C000350F9 /* TransitionMask.jpg
in Resources */,
CEB735A20C4A8CD6000350F9 /*
TransitionShading.tiff in Resources */,
+ CE2082E30C5E09DC009D3EFB /*
ResizeLeftDownCursor.tiff in Resources */,
+ CE2082E40C5E09DC009D3EFB /*
ResizeLeftUpCursor.tiff in Resources */,
+ CE2082E50C5E09DC009D3EFB /*
ResizeRightDownCursor.tiff in Resources */,
+ CE2082E60C5E09DC009D3EFB /*
ResizeRightUpCursor.tiff in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit