Changeset 3887
- Timestamp:
- 03/07/06 00:30:46 (3 years ago)
- Files:
-
- Footagehead/trunk/English.lproj/Localizable.strings (modified) (2 diffs)
- Footagehead/trunk/English.lproj/MainMenu.nib/classes.nib (modified) (4 diffs)
- Footagehead/trunk/English.lproj/MainMenu.nib/info.nib (modified) (2 diffs)
- Footagehead/trunk/English.lproj/MainMenu.nib/keyedobjects.nib (modified) (previous)
- Footagehead/trunk/English.lproj/MainMenu.nib/objects.nib (modified) (previous)
- Footagehead/trunk/FHController.h (modified) (2 diffs)
- Footagehead/trunk/FHController.m (modified) (17 diffs)
- Footagehead/trunk/FHFullscreenWindow.m (modified) (1 diff)
- Footagehead/trunk/FHImageView.h (modified) (3 diffs)
- Footagehead/trunk/FHImageView.m (modified) (7 diffs)
- Footagehead/trunk/FHSettings.h (modified) (1 diff)
- Footagehead/trunk/FHSettings.m (modified) (2 diffs)
- Footagehead/trunk/Japanese.lproj/Localizable.strings (modified) (1 diff)
- Footagehead/trunk/Japanese.lproj/MainMenu.nib/classes.nib (modified) (3 diffs)
- Footagehead/trunk/Japanese.lproj/MainMenu.nib/info.nib (modified) (2 diffs)
- Footagehead/trunk/Japanese.lproj/MainMenu.nib/keyedobjects.nib (modified) (previous)
- Footagehead/trunk/Japanese.lproj/MainMenu.nib/objects.nib (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/English.lproj/Localizable.strings
r3876 r3887 2 2 "%@ %C %u/%u" = "%1$@ %2$C %3$u/%4$u"; 3 3 4 /* 'image.jpg, 640x480 , zoomed at 100%' */5 "%@, %.0fx%.0f , zoomed at %.0f%%" = "%1$@, %2$.0fx%3$.0f, zoomed at %4$.0f%%";4 /* 'image.jpg, 640x480' */ 5 "%@, %.0fx%.0f" = "%1$@, %2$.0fx%3$.0f"; 6 6 7 7 /* '20 items, 10 images' */ 8 8 "%u %@, %u %@" = "%1$u %2$@, %3$u %4$@"; 9 9 10 /* ', rotated by 90' */ 11 ", rotated by %.0f" = ", rotated by %.0f°"; 12 13 /* ', scaled to 50%' */ 14 ", scaled to %.0f%%" = ", scaled to %.0f%%"; 15 10 16 /* Spotlight query (query) */ 11 "\"%@\"" = " \"%@\"";17 "\"%@\"" = "“%@”"; 12 18 13 19 /* Color black */ … … 37 43 /* Color white */ 38 44 "White" = "White"; 39 Footagehead/trunk/English.lproj/MainMenu.nib/classes.nib
r3879 r3887 4 4 { 5 5 ACTIONS = { 6 autoSwitch = id; 6 7 delete = id; 7 8 firstFile = id; … … 22 23 setAsDesktopPicture = id; 23 24 slideshow = id; 24 slideshowButtons = id;25 25 zoom = id; 26 26 }; … … 45 45 "_rightStatusTextField" = NSTextField; 46 46 "_rightView" = NSView; 47 "_rotateRightButton" = NSButton;48 47 "_screenAutoSwitchButton" = NSButton; 49 48 "_screenAutoSwitchTextField" = NSTextField; … … 51 50 "_screenPanel" = NSPanel; 52 51 "_screenPopUpButton" = NSPopUpButton; 52 "_screenZoomMatrix" = NSMatrix; 53 53 "_scrollView" = NSScrollView; 54 54 "_splitView" = WISplitView; Footagehead/trunk/English.lproj/MainMenu.nib/info.nib
r3879 r3887 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string> 423 67 395 374 0 0 1152 746</string>6 <string>893 73 395 374 0 0 1920 1178 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> … … 18 18 <key>IBOpenObjects</key> 19 19 <array> 20 <integer>21</integer>21 20 <integer>438</integer> 22 21 </array> Footagehead/trunk/FHController.h
r3879 r3887 55 55 IBOutlet NSPanel *_screenPanel; 56 56 IBOutlet NSPopUpButton *_screenPopUpButton; 57 IBOutlet NSMatrix *_screenZoomMatrix; 57 58 IBOutlet NSPopUpButton *_screenBackgroundPopUpButton; 58 59 IBOutlet NSButton *_screenAutoSwitchButton; … … 104 105 - (IBAction)rotateRight:(id)sender; 105 106 - (IBAction)slideshow:(id)sender; 106 - (IBAction) slideshowButtons:(id)sender;107 - (IBAction)autoSwitch:(id)sender; 107 108 - (IBAction)revealInFinder:(id)sender; 108 109 - (IBAction)setAsDesktopPicture:(id)sender; Footagehead/trunk/FHController.m
r3883 r3887 397 397 [self _updateFullscreenStatus]; 398 398 [_loadImageTimer setFireDate:[NSDate dateWithTimeIntervalSinceNow: 399 [FHSettings intForKey:FH AutoSwitchTime]]];399 [FHSettings intForKey:FHFullscreenAutoSwitchTime]]]; 400 400 } else { 401 401 // --- display error in fullscreen … … 610 610 [item setImage:[NSImage imageNamed:@"Black"]]; 611 611 [item setRepresentedObject:[NSColor blackColor]]; 612 [item setTag:FH BackgroundBlack];612 [item setTag:FHFullscreenBackgroundBlack]; 613 613 [[_screenBackgroundPopUpButton menu] addItem:item]; 614 614 [item release]; … … 617 617 [item setImage:[NSImage imageNamed:@"Gray"]]; 618 618 [item setRepresentedObject:[NSColor grayColor]]; 619 [item setTag:FH BackgroundGray];619 [item setTag:FHFullscreenBackgroundGray]; 620 620 [[_screenBackgroundPopUpButton menu] addItem:item]; 621 621 [item release]; … … 624 624 [item setImage:[NSImage imageNamed:@"White"]]; 625 625 [item setRepresentedObject:[NSColor whiteColor]]; 626 [item setTag:FH BackgroundWhite];626 [item setTag:FHFullscreenBackgroundWhite]; 627 627 [[_screenBackgroundPopUpButton menu] addItem:item]; 628 628 [item release]; … … 686 686 687 687 - (void)_updateRightStatus { 688 NSSize imageSize, frameSize; 689 double zoom = 100.0; 688 NSMutableString *string; 689 NSSize imageSize, frameSize; 690 double zoom; 691 float size; 690 692 691 693 if(![_imageView image]) { … … 703 705 } 704 706 707 if(ABS([_imageView imageRotation]) == 90 || ABS([_imageView imageRotation]) == 270) { 708 size = imageSize.width; 709 imageSize.width = imageSize.height; 710 imageSize.height = size; 711 } 712 705 713 frameSize = [NSScrollView frameSizeForContentSize:[_imageView frame].size 706 714 hasHorizontalScroller:[_scrollView hasHorizontalScroller] … … 719 727 zoom = 100.0; 720 728 721 [_rightStatusTextField setStringValue:[NSSWF:NSLS(@"%@, %.0fx%.0f, zoomed at %.0f%%", @"'image.jpg, 640x480, zoomed at 100%'"),729 string = [[NSMutableString alloc] initWithFormat:NSLS(@"%@, %.0fx%.0f", @"'image.jpg, 640x480'"), 722 730 [[self _selectedFile] name], 723 731 imageSize.width, 724 imageSize.height, 725 zoom]]; 732 imageSize.height]; 733 734 if(zoom != 100.0) { 735 [string appendFormat:NSLS(@", scaled to %.0f%%", @"', scaled to 50%'"), 736 zoom]; 737 } 738 739 if([_imageView imageRotation] != 0.0) { 740 [string appendFormat:NSLS(@", rotated by %.0f", @"', rotated by 90'"), 741 ABS([_imageView imageRotation])]; 742 } 743 744 [_rightStatusTextField setStringValue:string]; 745 746 [string release]; 726 747 } 727 748 … … 800 821 [self setWindowFrameAutosaveName:@"Footagehead"]; 801 822 802 if([FHSettings intForKey:FHImageScaling ] == NSScaleNone)823 if([FHSettings intForKey:FHImageScalingMethod] != FHScaleProportionally) 803 824 [_zoomButton setState:NSOnState]; 804 825 … … 806 827 [self _reloadScreens]; 807 828 808 if([FHSettings intForKey:FH Screen] < [_screenPopUpButton numberOfItems])809 [_screenPopUpButton selectItemAtIndex:[FHSettings intForKey:FH Screen]];829 if([FHSettings intForKey:FHFullscreenScreen] < [_screenPopUpButton numberOfItems]) 830 [_screenPopUpButton selectItemAtIndex:[FHSettings intForKey:FHFullscreenScreen]]; 810 831 811 832 [self _reloadScreenBackgrounds]; 812 833 813 [_screenBackgroundPopUpButton selectItemWithTag:[FHSettings intForKey:FHBackground]]; 814 815 [_screenAutoSwitchButton setState:[FHSettings boolForKey:FHAutoSwitch]]; 816 [_screenAutoSwitchTextField setEnabled:[FHSettings boolForKey:FHAutoSwitch]]; 817 [_screenAutoSwitchTextField setIntValue:[FHSettings intForKey:FHAutoSwitchTime]]; 818 819 [_imageView setImageScaling:[FHSettings intForKey:FHImageScaling]]; 834 [_screenZoomMatrix selectCellWithTag:[FHSettings intForKey:FHFullscreenImageScalingMethod]]; 835 [_screenBackgroundPopUpButton selectItemWithTag:[FHSettings intForKey:FHFullscreenBackground]]; 836 837 [_screenAutoSwitchButton setState:[FHSettings boolForKey:FHFullscreenAutoSwitch]]; 838 [_screenAutoSwitchTextField setEnabled:[FHSettings boolForKey:FHFullscreenAutoSwitch]]; 839 [_screenAutoSwitchTextField setIntValue:[FHSettings intForKey:FHFullscreenAutoSwitchTime]]; 840 841 [_imageView setImageScaling:[FHSettings intForKey:FHImageScalingMethod]]; 820 842 [_imageView setImageRotation:[FHSettings floatForKey:FHImageRotation]]; 821 843 … … 916 938 917 939 [_handler release]; 940 _handler = NULL; 918 941 } 919 942 … … 985 1008 986 1009 [self showWindow:self]; 1010 1011 _fullscreenWindow = NULL; 1012 987 1013 [self _updateImage]; 988 [_tableView scrollRowToVisible:[_tableView selectedRow]];989 990 _fullscreenWindow = NULL;991 1014 } 992 1015 } … … 1385 1408 1386 1409 - (IBAction)zoom:(id)sender { 1387 NSImageScaling scaling; 1388 1389 scaling = [_imageView imageScaling]; 1390 1391 if(scaling == NSScaleNone) 1392 scaling = NSScaleProportionally; 1393 else 1394 scaling = NSScaleNone; 1395 1396 [_imageView setImageScaling:scaling]; 1397 1398 [self _updateRightStatus]; 1399 1400 [FHSettings setInt:scaling forKey:FHImageScaling]; 1410 FHImageScaling scaling; 1411 1412 if(_fullscreenWindow) { 1413 scaling = [_fullscreenImageView imageScaling]; 1414 1415 if(scaling != FHScaleProportionally) 1416 scaling = FHScaleProportionally; 1417 else 1418 scaling = FHScaleStretched; 1419 1420 [_fullscreenImageView setImageScaling:scaling]; 1421 } else { 1422 scaling = [_imageView imageScaling]; 1423 1424 if(scaling != FHScaleProportionally) 1425 scaling = FHScaleProportionally; 1426 else 1427 scaling = FHScaleNone; 1428 1429 [_imageView setImageScaling:scaling]; 1430 1431 [self _updateRightStatus]; 1432 1433 [FHSettings setInt:scaling forKey:FHImageScalingMethod]; 1434 } 1401 1435 } 1402 1436 … … 1414 1448 1415 1449 [_imageView setImageRotation:rotation]; 1416 1450 [_fullscreenImageView setImageRotation:rotation]; 1451 1452 [self _updateRightStatus]; 1453 1417 1454 [FHSettings setFloat:rotation forKey:FHImageRotation]; 1418 1455 } … … 1439 1476 if(returnCode == NSRunStoppedResponse) { 1440 1477 // --- save in prefs 1441 [FHSettings setInt:[_screenPopUpButton indexOfSelectedItem] forKey:FHScreen]; 1442 [FHSettings setInt:[_screenBackgroundPopUpButton tagOfSelectedItem] forKey:FHBackground]; 1443 [FHSettings setBool:[_screenAutoSwitchButton state] forKey:FHAutoSwitch]; 1444 [FHSettings setInt:[_screenAutoSwitchTextField intValue] forKey:FHAutoSwitchTime]; 1478 [FHSettings setInt:[_screenPopUpButton indexOfSelectedItem] forKey:FHFullscreenScreen]; 1479 [FHSettings setInt:[[_screenZoomMatrix selectedCell] tag] forKey:FHFullscreenImageScalingMethod]; 1480 [FHSettings setInt:[_screenBackgroundPopUpButton tagOfSelectedItem] forKey:FHFullscreenBackground]; 1481 [FHSettings setBool:[_screenAutoSwitchButton state] forKey:FHFullscreenAutoSwitch]; 1482 [FHSettings setInt:[_screenAutoSwitchTextField intValue] forKey:FHFullscreenAutoSwitchTime]; 1445 1483 1446 1484 // --- get screen 1447 screenNumber = [FHSettings intForKey:FH Screen];1485 screenNumber = [FHSettings intForKey:FHFullscreenScreen]; 1448 1486 1449 1487 if((unsigned int) screenNumber > [[NSScreen screens] count]) … … 1467 1505 [_fullscreenWindow setTitle:[[self window] title]]; 1468 1506 [_fullscreenImageView setBackgroundColor:[_screenBackgroundPopUpButton representedObjectOfSelectedItem]]; 1507 [_fullscreenImageView setImageScaling:[[_screenZoomMatrix selectedCell] tag]]; 1508 [_fullscreenImageView setImageRotation:[_imageView imageRotation]]; 1469 1509 [_fullscreenPanel setFrame:screenRect display:NO]; 1470 1510 [_fullscreenWindow setContentView:[[_fullscreenPanel contentView] retain]]; … … 1473 1513 [self _updateImage]; 1474 1514 1475 if([FHSettings boolForKey:FH AutoSwitch]) {1476 _loadImageTimer = [[NSTimer scheduledTimerWithTimeInterval:[FHSettings intForKey:FH AutoSwitchTime]1515 if([FHSettings boolForKey:FHFullscreenAutoSwitch]) { 1516 _loadImageTimer = [[NSTimer scheduledTimerWithTimeInterval:[FHSettings intForKey:FHFullscreenAutoSwitchTime] 1477 1517 target:self 1478 1518 selector:@selector(loadFileTimer:) … … 1485 1525 1486 1526 1487 - (IBAction) slideshowButtons:(id)sender {1527 - (IBAction)autoSwitch:(id)sender { 1488 1528 [_screenAutoSwitchTextField setEnabled:[_screenAutoSwitchButton state]]; 1489 1529 } Footagehead/trunk/FHFullscreenWindow.m
r2954 r3887 49 49 50 50 [self close]; 51 52 handled = YES; 53 } 54 else if([event commandKeyModifier] && c == 't') { 55 [[self delegate] rotateRight:self]; 56 57 handled = YES; 58 } 59 else if([event commandKeyModifier] && c == 'e') { 60 [[self delegate] zoom:self]; 51 61 52 62 handled = YES; Footagehead/trunk/FHImageView.h
r3879 r3887 27 27 */ 28 28 29 enum _FHImageScaling { 30 FHScaleProportionally = 0, 31 FHScaleToFit, 32 FHScaleStretched, 33 FHScaleNone, 34 }; 35 typedef enum _FHImageScaling FHImageScaling; 36 37 29 38 @class FHImage; 30 39 … … 33 42 34 43 FHImage *_image; 35 NSImageScaling _imageScaling;44 FHImageScaling _imageScaling; 36 45 float _imageRotation; 37 46 … … 47 56 - (void)setImage:(FHImage *)image; 48 57 - (FHImage *)image; 49 - (void)setImageScaling:( NSImageScaling)newScaling;50 - ( NSImageScaling)imageScaling;58 - (void)setImageScaling:(FHImageScaling)newScaling; 59 - (FHImageScaling)imageScaling; 51 60 - (void)setImageRotation:(float)rotation; 52 61 - (float)imageRotation; Footagehead/trunk/FHImageView.m
r3882 r3887 43 43 44 44 - (void)_initImageView { 45 _imageScaling = NSScaleProportionally;45 _imageScaling = FHScaleProportionally; 46 46 _backgroundColor = [[NSColor whiteColor] retain]; 47 47 … … 87 87 contentSize = [_scrollView contentSize]; 88 88 89 if(_image && _imageScaling == NSScaleNone) {89 if(_image && _imageScaling == FHScaleNone) { 90 90 imageSize = _image ? [_image size] : NSZeroSize; 91 91 … … 175 175 176 176 177 - (void)setImageScaling:( NSImageScaling)imageScaling {177 - (void)setImageScaling:(FHImageScaling)imageScaling { 178 178 _imageScaling = imageScaling; 179 179 … … 184 184 185 185 186 - ( NSImageScaling)imageScaling {186 - (FHImageScaling)imageScaling { 187 187 return _imageScaling; 188 188 } … … 313 313 314 314 switch (_imageScaling) { 315 case NSScaleProportionally: 315 case FHScaleProportionally: 316 case FHScaleStretched: 316 317 if(ABS(_imageRotation) == 90.0 || ABS(_imageRotation) == 270.0) { 317 318 dx = bounds.size.width / rect.size.height; … … 324 325 d = dx < dy ? dx : dy; 325 326 326 if(d < 1.0 ) {327 if(d < 1.0 || _imageScaling == FHScaleStretched) { 327 328 rect.size.width = floorf(rect.size.width * d); 328 329 rect.size.height = floorf(rect.size.height * d); … … 330 331 break; 331 332 332 case NSScaleToFit:333 case FHScaleToFit: 333 334 rect.size = bounds.size; 334 335 break; 335 336 case NSScaleNone:336 337 case FHScaleNone: 337 338 break; 338 339 } Footagehead/trunk/FHSettings.h
r3879 r3887 29 29 @interface FHSettings : WISettings 30 30 31 #define FHOpenURL @"FHOpenURL" 32 #define FHScreen @"FHScreen" 33 #define FHImageScaling @"FHImageScaling" 34 #define FHImageRotation @"FHImageRotation" 35 #define FHBackground @"FHBackground" 36 #define FHBackgroundBlack 0 37 #define FHBackgroundGray 1 38 #define FHBackgroundWhite 2 39 #define FHAutoSwitch @"FHAutoSwitch" 40 #define FHAutoSwitchTime @"FHAutoSwitchTime" 31 #define FHOpenURL @"FHOpenURL" 32 #define FHImageScalingMethod @"FHImageScalingMethod" 33 #define FHImageRotation @"FHImageRotation" 34 #define FHFullscreenScreen @"FHFullscreenScreen" 35 #define FHFullscreenImageScalingMethod @"FHFullscreenImageScalingMethod" 36 #define FHFullscreenBackground @"FHFullscreenBackground" 37 #define FHFullscreenBackgroundBlack 0 38 #define FHFullscreenBackgroundGray 1 39 #define FHFullscreenBackgroundWhite 2 40 #define FHFullscreenAutoSwitch @"FHFullscreenAutoSwitch" 41 #define FHFullscreenAutoSwitchTime @"FHFullscreenAutoSwitchTime" 41 42 42 43 @end Footagehead/trunk/FHSettings.m
r3879 r3887 28 28 29 29 #import "FHHandler.h" 30 #import "FHImageView.h" 30 31 #import "FHSettings.h" 31 32 … … 36 37 [[WIURL fileURLWithPath:NSHomeDirectory()] string], 37 38 FHOpenURL, 38 [NSNumber numberWithInt:0], 39 FHScreen, 40 [NSNumber numberWithInt:NSScaleProportionally], 41 FHImageScaling, 39 [NSNumber numberWithInt:FHScaleProportionally], 40 FHImageScalingMethod, 42 41 [NSNumber numberWithFloat:0.0f], 43 42 FHImageRotation, 44 [NSNumber numberWithInt:FHBackgroundBlack], 45 FHBackground, 43 [NSNumber numberWithInt:0], 44 FHFullscreenScreen, 45 [NSNumber numberWithInt:FHScaleProportionally], 46 FHFullscreenImageScalingMethod, 47 [NSNumber numberWithInt:FHFullscreenBackgroundBlack], 48 FHFullscreenBackground, 46 49 [NSNumber numberWithBool:NO], 47 FH AutoSwitch,50 FHFullscreenAutoSwitch, 48 51 [NSNumber numberWithInt:5], 49 FH AutoSwitchTime,52 FHFullscreenAutoSwitchTime, 50 53 NULL]; 51 54 } Footagehead/trunk/Japanese.lproj/Localizable.strings
r3878 r3887 2 2 "%@ %C %u/%u" = "%1$@ %2$C %3$u/%4$u"; 3 3 4 /* 'image.jpg, 640x480 , zoomed at 100%' */5 "%@, %.0fx%.0f , zoomed at %.0f%%" = "%1$@, %2$.0fx%3$.0f, ズーム: %4$.0f%%";4 /* 'image.jpg, 640x480' */ 5 "%@, %.0fx%.0f" = "%1$@, %2$.0fx%3$.0f"; 6 6 7 7 /* '20 items, 10 images' */ 8 8 "%u %@, %u %@" = "%1$u %2$@, %3$u %4$@"; 9 10 /* ', rotated by 90' */ 11 ", rotated by %.0f" = ", rotated by %.0f°"; 12 13 /* ', scaled to 50%' */ 14 ", scaled to %.0f%%" = ", scaled to %.0f%%"; 9 15 10 16 /* Spotlight query (query) */ Footagehead/trunk/Japanese.lproj/MainMenu.nib/classes.nib
r3879 r3887 4 4 { 5 5 ACTIONS = { 6 autoSwitch = id; 6 7 delete = id; 7 8 firstFile = id; … … 22 23 setAsDesktopPicture = id; 23 24 slideshow = id; 24 slideshowButtons = id;25 25 zoom = id; 26 26 }; … … 50 50 "_screenPanel" = NSPanel; 51 51 "_screenPopUpButton" = NSPopUpButton; 52 "_screenZoomMatrix" = NSMatrix; 52 53 "_scrollView" = NSScrollView; 53 54 "_splitView" = WISplitView; Footagehead/trunk/Japanese.lproj/MainMenu.nib/info.nib
r3879 r3887 8 8 <dict> 9 9 <key>29</key> 10 <string> 451 599 380 44 0 0 1280 1002</string>10 <string>772 709 380 44 0 0 1920 1178 </string> 11 11 <key>571</key> 12 <string> 60 884 316 118 0 0 1280 1002</string>12 <string>100 1060 316 118 0 0 1920 1178 </string> 13 13 </dict> 14 14 <key>IBFramework Version</key> … … 16 16 <key>IBOpenObjects</key> 17 17 <array> 18 <integer>534</integer>19 <integer>29</integer>20 18 <integer>438</integer> 21 <integer>21</integer>22 <integer>571</integer>23 19 </array> 24 20 <key>IBSystem Version</key>
