Permalink
Browse files

Fixes for 10.9

  • Loading branch information...
Robert Chin
Robert Chin committed Mar 14, 2014
1 parent 0f65283 commit d118bb6a78c13051cb0df596b3bde5228bd36ade
Showing with 580 additions and 3,442 deletions.
  1. +2 −2 .hgsubstate
  2. +2 −4 Classes/FadeOut.m
  3. +1 −1 Classes/NPApplication.h
  4. +11 −6 Classes/NPApplication.m
  5. +1 −1 Classes/NiceController.m
  6. +1 −0 Classes/NiceDocument.h
  7. +6 −5 Classes/NiceDocument.m
  8. +1 −1 Classes/NiceWindow/NPOutlineView.m
  9. +6 −3 Classes/NiceWindow/NiceWindow.h
  10. +26 −12 Classes/NiceWindow/NiceWindow.m
  11. +2 −2 Classes/Overlay Widgets/BlackWindow.m
  12. +1 −0 Classes/Overlay Widgets/JTTextFittingView.h
  13. +2 −2 Classes/Overlay Widgets/OverlayControllerWindow.m
  14. +1 −1 Classes/Overlay Widgets/OverlayTitleWindow.m
  15. +1 −1 Classes/Overlay Widgets/OverlayWindow.m
  16. +2 −1 Classes/Overlay Widgets/OverlaysControl.m
  17. +1 −1 Classes/Overlay Widgets/ResizeTriangle.m
  18. +2 −2 Classes/Scripting/NiceDocumentScripting.m
  19. +1 −1 Classes/Subtitle.m
  20. +2 −0 Classes/Viewer Interface/NPMovieView.h
  21. +5 −5 Classes/Viewer Interface/NPMovieView.m
  22. +4 −0 Classes/Viewer Interface/NPPluginReader.m
  23. +4 −0 Classes/Viewer Interface/Pluggable Players/JTMovieView.h
  24. +3 −0 Classes/Viewer Interface/Pluggable Players/JTMovieView.m
  25. +9 −0 Classes/Viewer Interface/Pluggable Players/NPMovieProtocol.h
  26. +8 −8 Classes/Viewer Interface/Pluggable Players/NPPluginView.m
  27. +16 −62 Classes/Viewer Interface/Pluggable Players/RCMovieView.m
  28. +414 −3,252 English.lproj/NiceDocument.xib
  29. +5 −1 Info.plist
  30. +1 −13 Libraries/AppScript/src/Appscript/Appscript.xcodeproj/project.pbxproj
  31. +2 −0 Libraries/AppScript/src/Appscript/codecs.m
  32. +1 −4 Libraries/AppScript/src/Appscript/connect.m
  33. +0 −1 Libraries/AppScript/src/Appscript/constant.m
  34. +2 −1 Libraries/AppScript/src/Appscript/types.h
  35. +2 −1 Libraries/AppScript/src/Appscript/types.m
  36. +1 −1 Libraries/UniversalCharsetDetector/UniversalCharsetDetector.xcodeproj/project.pbxproj
  37. +1 −5 Libraries/sparkle/Sparkle.xcodeproj/project.pbxproj
  38. +1 −1 Libraries/stenum/STEnum10.4.xcodeproj/project.pbxproj
  39. +3 −9 NicePlayer.xcodeproj/project.pbxproj
  40. +3 −3 Other Sources/NiceUtilities.m
  41. +1 −9 Plugin Sources/DVDPlayer/DVDPlayer.xcodeproj/project.pbxproj
  42. +14 −20 Plugin Sources/DVDPlayer/DVDPlayerView.m
  43. +8 −0 Plugin Sources/DVDPlayer/NPMovieProtocol.h
View
@@ -1,2 +1,2 @@
fee4f8fa047ae54236752b41d5df65052af9eec5 Libraries/cocoascriptmenu
7ff3f63112213e425b35a39e528303917bb746d5 Libraries/preferable
481b3676719aaaa986ddfb4cfb5716e061ee9b3a Libraries/cocoascriptmenu
ae59c98f11189be1b724ea4998bd77c5ce05a23a Libraries/preferable
View
@@ -143,8 +143,7 @@ -(void)destroyAndCreateTimer
-(void)updateAlphaValues
{
id anObject, e = [windowSet objectEnumerator];
while((anObject = [e nextObject])){
for(id anObject in windowSet){
float newValue = [anObject alphaValue] - ALPHA_VALUE_DELTA;
newValue = (newValue < 0.0) ? 0.0 : newValue;
[anObject setAlphaValue:newValue];
@@ -156,8 +155,7 @@ -(void)updateAlphaValues
-(void)testForRemoval
{
id newSet = [NSMutableSet set];
id anObject, e = [windowSet objectEnumerator];
while((anObject = [e nextObject])){
for(id anObject in windowSet){
if([anObject alphaValue] > 0.0)
[newSet addObject:anObject];
}
View
@@ -50,7 +50,7 @@
@class SUUpdater;
@class RemoteControl;
@interface NPApplication : NSApplication {
@interface NPApplication : NSApplication<NSApplicationDelegate> {
NSTimer *inactiveTimer;
NSPoint lastPoint;
IBOutlet SUUpdater* sparkleUpdater;
View
@@ -117,12 +117,12 @@ -(void)moveOldDefaultScriptsAndCopy{
NSDictionary* tDict = [NSDictionary dictionaryWithContentsOfFile:[tPath stringByAppendingPathComponent:@".info.plist"]];
if ([[tDict objectForKey:@"BuildNumber"] compare:@"569"] == NSOrderedAscending){
if ([[tDict objectForKey:@"BuildNumber"] compare:@"569" options:0] == NSOrderedAscending){
NSCalendarDate* tDate =[NSCalendarDate date];
NSString* tFormattedDate = [tDate descriptionWithCalendarFormat:@"_%Y_%m_%d"];
[[NSFileManager defaultManager] movePath:tPath toPath:[tPath stringByAppendingString:tFormattedDate] handler:nil];
[[NSFileManager defaultManager] moveItemAtPath:tPath toPath:[tPath stringByAppendingString:tFormattedDate] error:nil];
[self copyDefaultScriptsToApplicationSupport];
}
}
@@ -133,10 +133,10 @@ -(void)copyDefaultScriptsToApplicationSupport{
NSString* tPath =[[[TTCSearchPathForDirectoriesInDomains(TTCApplicationSupportDirectory,NSUserDomainMask,YES) firstObject] stringByAppendingPathComponent:@"NicePlayer"] stringByAppendingPathComponent:@"Scripts"];
if([[NSFileManager defaultManager] fileExistsAtPath:tPath]){
[[NSFileManager defaultManager] removeFileAtPath:tPath handler:nil];
[[NSFileManager defaultManager] removeItemAtPath:tPath error:nil];
}
[[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] pathForResource:@"Default Scripts" ofType:@""] toPath:tPath handler:nil];
[[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] pathForResource:@"Default Scripts" ofType:@""] toPath:tPath error:nil];
[[NSDictionary dictionaryWithObjectsAndKeys:[[[NSBundle mainBundle] infoDictionary] objectForKey:
@"CFBundleVersion"],@"BuildNumber",[[[NSBundle mainBundle] infoDictionary] objectForKey:
@"CFBundleShortVersionString"],@"VersionNumber",nil] writeToFile:[tPath stringByAppendingPathComponent:@".info.plist"] atomically:NO];
@@ -251,7 +251,12 @@ - (void)sendEvent:(NSEvent *)anEvent
-(NSArray *)movieWindows
{
return [[super orderedWindows] selectUsingFunction:selectNiceWindow context:nil];
NSMutableArray *returnArray = [NSMutableArray array];
[[[super orderedWindows] selectUsingFunction:selectNiceWindow context:nil] enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop){
if([obj isVisible])
[returnArray addObject:obj];
}];
return returnArray;
}
-(id)bestMovieWindow
@@ -270,7 +275,7 @@ -(IBAction)emailAuthor:(id)sender{
if(tempEmail == nil){
NSRunAlertPanel(@"Email", @"Contact email address not provided by author.", @"Okay",nil,nil);
}else{
NSLog([NSString stringWithFormat:@"mailto:%@?subject=%@/%@(v%@)",tempEmail,[tempInfo objectForKey:@"CFBundleName"],[tempInfo objectForKey:@"CFBundleShortVersionString"],[tempInfo objectForKey:@"CFBundleVersion"],nil]);
NSLog(@"%@", [NSString stringWithFormat:@"mailto:%@?subject=%@/%@(v%@)",tempEmail,[tempInfo objectForKey:@"CFBundleName"],[tempInfo objectForKey:@"CFBundleShortVersionString"],[tempInfo objectForKey:@"CFBundleVersion"],nil]);
[[NSWorkspace sharedWorkspace ]openURL: [NSURL URLWithString:[NSString stringWithFormat:@"mailto:%@?subject=%@/%@(v%@)",tempEmail,[tempInfo objectForKey:@"CFBundleName"],[tempInfo objectForKey:@"CFBundleShortVersionString"],[tempInfo objectForKey:@"CFBundleVersion"],nil]]];
}
}
View
@@ -130,7 +130,7 @@ -(id)mainWindowProxy
return mainWindowProxy;
}
-(int)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)openableFileExtensions
-(NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)openableFileExtensions
{
[openPanel setAllowsMultipleSelection:YES];
[openPanel setCanChooseDirectories:YES];
View
@@ -64,6 +64,7 @@
IBOutlet id theRepeatButton;
IBOutlet id theRandomButton;
IBOutlet NiceWindow *theWindow;
IBOutlet NSOutlineView *playlistOutlineView;
NSURL* theCurrentURL;
unsigned int _randomIndex;
NSMutableArray* _randomList;
View
@@ -70,7 +70,7 @@ BOOL rejectSelf(id each,void* context){
return [each isEqual:[(NiceDocument*)context window]];
}
int sortByMain(id v1, id v2, void* context){
NSInteger sortByMain(id v1, id v2, void* context){
if([v1 isEqualTo:v2])
return NSOrderedSame;
if([[NSScreen mainScreen] isEqualTo: v1]){
@@ -181,6 +181,7 @@ -(void)dealloc
[theDataSourceCache release];
[theMainItemCache release];
[_randomList release];
[playlistOutlineView setDataSource:nil];
[super dealloc];
}
@@ -221,7 +222,7 @@ - (NSData *)dataRepresentationOfType:(NSString *)aType
NSData* tData = [NSPropertyListSerialization dataFromPropertyList:tDict format:NSPropertyListXMLFormat_v1_0 errorDescription:&tErrror];
if(tData == nil)
NSLog(tErrror);
NSLog(@"%@", tErrror);
return tData;
@@ -1098,7 +1099,7 @@ -(void)addURLToPlaylist:(NSURL*)aURL atIndex:(int)anIndex
-(void)removeURLFromPlaylist:(NSURL*)aURL
{
int tempIndex = [thePlaylist indexOfObject:aURL];
NSUInteger tempIndex = [thePlaylist indexOfObject:aURL];
if(tempIndex != NSNotFound)
[self removeURLFromPlaylistHelperAtIndex:[NSIndexSet indexSetWithIndex:tempIndex]];
}
@@ -1206,7 +1207,7 @@ - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTabl
if([[aTableColumn identifier] isEqualTo:@"index"]){
if([[item objectForKey:@"type"] isEqualTo:@"chapter"]){
if( [[item objectForKey:@"url"] isEqualTo:[theMovieView currentChapter]])
return [NSString stringWithFormat:@"%C", 0x2022];
return [NSString stringWithFormat:@"%C", (unichar)0x2022];
return @"";
}
@@ -1220,7 +1221,7 @@ - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTabl
return [item objectForKey:@"self"] ;
}else if ([[aTableColumn identifier] isEqualTo:@"status"]){
if ([[item objectForKey:@"url"] isEqual: theCurrentURL])
return [NSString stringWithFormat:@"%C", 0x2022];
return [NSString stringWithFormat:@"%C", (unichar)0x2022];
else
return @"";
}else if ([[aTableColumn identifier] isEqualTo:@"none"]){
@@ -12,7 +12,7 @@
@implementation NPOutlineView
- (NSImage *)dragImageForRowsWithIndexes:(NSIndexSet *)dragRows tableColumns:(NSArray *)tableColumns event:(NSEvent*)dragEvent offset:(NSPointPointer)dragImageOffset{
NSMutableArray* tArray =[NSMutableArray array];
unsigned current_index = [dragRows firstIndex];
NSUInteger current_index = [dragRows firstIndex];
while (current_index != NSNotFound)
{
id tItem = [self itemAtRow:current_index];
@@ -45,6 +45,7 @@
@class NPMovieView;
@class NiceScrubber;
@class JTTextFittingView;
@interface NiceWindow : NSWindow
{
@@ -53,7 +54,7 @@
IBOutlet id theOverlayTitleBar;
IBOutlet id theOverlayVolume;
IBOutlet id theOverlaySubTitleWindow;
IBOutlet id theOverlaySubTitle;
IBOutlet JTTextFittingView *theOverlaySubTitle;
IBOutlet id theOverlayNotifier;
IBOutlet id theVolumeView;
IBOutlet id theTitleField;
@@ -89,7 +90,7 @@
float miniVolume;
NSRect beforeFullScreen;
id initialFadeTimer;
NSTimer *initialFadeTimer;
NSSize aspectRatio;
NSPoint initialDrag;
@@ -171,7 +172,7 @@
-(void)floatWindow;
-(void)unfloatWindow;
-(BOOL)isFullScreen;
-(void)setLevel:(int)windowLevel;
-(void)setLevel:(NSInteger)windowLevel;
-(void)resizeWithSize:(NSSize)aSize animate:(BOOL)animate;
-(NSRect)calcResizeSize:(NSSize)aSize;
-(void)resize:(float)amount animate:(BOOL)animate;
@@ -219,4 +220,6 @@
-(NSArray *)acceptableDragTypes;
@property(readwrite,retain) NSTimer *initialFadeTimer;
@end
@@ -82,7 +82,7 @@ -(float)titlebarHeight{
}
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(unsigned int)aStyle
styleMask:(NSUInteger)aStyle
backing:(NSBackingStoreType)bufferingType
defer:(BOOL)flag
{
@@ -99,11 +99,11 @@ - (id)initWithContentRect:(NSRect)contentRect
name:@"unPresentMultiple"
object:nil];
timeUpdaterTimer = [NSTimer scheduledTimerWithTimeInterval:1
timeUpdaterTimer = [[NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(updateByTime:)
userInfo:nil
repeats:YES];
repeats:YES] retain];
[self setBackgroundColor:[NSColor blackColor]];
[self setOpaque:YES];
[self useOptimizedDrawing:YES];
@@ -117,7 +117,8 @@ - (id)initWithContentRect:(NSRect)contentRect
windowOverlayControllerIsShowing = NO;
titleOverlayIsShowing = NO;
fixedAspectRatio = YES;
initialFadeTimer = nil;
[initialFadeTimer release];
self.initialFadeTimer = nil;
isInitialDisplay = [[Preferences mainPrefs] showInitialOverlays];
timeDisplayStyle = [[Preferences mainPrefs] defaultTimeDisplay];
[[Preferences mainPrefs] addObserver:self
@@ -181,8 +182,8 @@ -(void)awakeFromNib
oldWindowLevel =[self level];
[thePlayButton setKeyEquivalent:@" "];
[theRRButton setKeyEquivalent:[NSString stringWithFormat:@"%C",NSLeftArrowFunctionKey,nil]];
[theFFButton setKeyEquivalent:[NSString stringWithFormat:@"%C",NSRightArrowFunctionKey,nil]];
[theRRButton setKeyEquivalent:[NSString stringWithFormat:@"%C",(unichar)NSLeftArrowFunctionKey,nil]];
[theFFButton setKeyEquivalent:[NSString stringWithFormat:@"%C",(unichar)NSRightArrowFunctionKey,nil]];
[thePlayButton setActionView:theMovieView];
[theRRButton setActionView:theMovieView];
@@ -197,9 +198,11 @@ -(void)close
[[FadeOut fadeOut] removeWindow:theOverlayTitleBar];
[[FadeOut fadeOut] removeWindow:theOverlayVolume];
[[FadeOut fadeOut] removeWindow:self];
if(initialFadeTimer)
[initialFadeTimer invalidate];
[self.initialFadeTimer invalidate];
self.initialFadeTimer = nil;
[timeUpdaterTimer invalidate];
[timeUpdaterTimer release];
timeUpdaterTimer = nil;
isClosing = YES;
@@ -211,6 +214,15 @@ -(void)close
[tPool release];
}
- (void)dealloc
{
[[FadeOut fadeOut] removeWindow:theOverlayControllerWindow];
[[FadeOut fadeOut] removeWindow:theOverlayTitleBar];
[[FadeOut fadeOut] removeWindow:theOverlayVolume];
[[FadeOut fadeOut] removeWindow:self];
[super dealloc];
}
#pragma mark Overriden Methods
-(void)resignMainWindow
@@ -474,7 +486,7 @@ -(void)setupOverlays
[NSArray arrayWithObjects:self, initialFadeObjects, @"initialFadeComplete", nil]
forKeys:
[NSArray arrayWithObjects:@"Window", @"Fade", @"Selector", nil]];
initialFadeTimer = [[FadeOut fadeOut] initialFadeForDict:fadeDict];
self.initialFadeTimer = [[FadeOut fadeOut] initialFadeForDict:fadeDict];
}
}
@@ -524,7 +536,7 @@ -(void)hideAllImmediately
-(void)initialFadeComplete
{
isInitialDisplay = NO;
initialFadeTimer = nil;
self.initialFadeTimer = nil;
}
-(BOOL)scrubberInUse{
@@ -689,7 +701,7 @@ -(void)setOverlayTitleLocation
[theOverlayTitleBar setFrame:NSMakeRect(visibleFrame.origin.x,
visibleFrame.origin.y
+ visibleFrame.size.height - [theOverlayTitleBar frame].size.height - [NSMenuView menuBarHeight],
+ visibleFrame.size.height - [theOverlayTitleBar frame].size.height - [[NSApp mainMenu] menuBarHeight],
visibleFrame.size.width,
[theOverlayTitleBar frame].size.height) display:YES];
@@ -964,7 +976,7 @@ -(BOOL)isFullScreen
/**
* Sets the window level by setting all of the windows and child windows to their own proper window levels.
*/
-(void)setLevel:(int)windowLevel
-(void)setLevel:(NSInteger)windowLevel
{
id enumerator = [[self childWindows] objectEnumerator];
id object;
@@ -1490,4 +1502,6 @@ -(NSArray *)acceptableDragTypes
return [NSArray arrayWithObjects:NSFilenamesPboardType,nil];
}
@synthesize initialFadeTimer;
@end
@@ -52,10 +52,10 @@ -(bool)canBeVisibleOnAllSpaces;
@implementation BlackWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{
NSWindow *result = [super initWithContentRect:contentRect
BlackWindow *result = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:YES];
@@ -56,4 +56,5 @@
-(void)setStringValue:(NSString*)aString;
-(NSString*)stringValue;
-(void)setMaxText:(NSString*)aTextRepresentingWidth;
-(void)setAttributes:(NSDictionary*)anAttributes;
@end
@@ -62,14 +62,14 @@ -(void)close
}
-(void)setAlphaValue:(float)windowAlpha
-(void)setAlphaValue:(CGFloat)windowAlpha
{
[overlayResize setAlphaValue:windowAlpha];
[super setAlphaValue:windowAlpha];
}
-(void)setLevel:(int)newLevel
-(void)setLevel:(NSInteger)newLevel
{
[overlayResize setLevel:newLevel];
[super setLevel:newLevel];
@@ -50,7 +50,7 @@
@implementation OverlayTitleWindow:OverlayWindow
-(id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
-(id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{
if((self = [super initWithContentRect:contentRect
@@ -48,7 +48,7 @@
@implementation OverlayWindow
-(id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
-(id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{
if((self = [super initWithContentRect:contentRect
@@ -45,6 +45,7 @@
#import "OverlaysControl.h"
#import "NiceWindow.h"
#import <AppKit/AppKit.h>
static id overlayControl = nil;
@@ -105,7 +106,7 @@ -(BOOL)inTitleRegion:(NSPoint)aScreenPoint forWindow:(NiceWindow*)aWindow
if([aWindow isFullScreen]){
NSRect mainScreenFrame = [[NSScreen mainScreen] frame];
return (aScreenPoint.y <= (mainScreenFrame.origin.y + mainScreenFrame.size.height)
&& aScreenPoint.y >= (mainScreenFrame.origin.y + mainScreenFrame.size.height - [aWindow titlebarHeight] - [NSMenuView menuBarHeight])
&& aScreenPoint.y >= (mainScreenFrame.origin.y + mainScreenFrame.size.height - [aWindow titlebarHeight] - [[NSApp mainMenu] menuBarHeight])
&& aScreenPoint.x >= mainScreenFrame.origin.x
&& aScreenPoint.x <= mainScreenFrame.size.width);
}
Oops, something went wrong.

0 comments on commit d118bb6

Please sign in to comment.