From 42f29c44e639b96a43b754b63904a972d1c5c600 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 1 Nov 2020 16:50:02 -0600 Subject: [PATCH] Remove OSPortabilityDefs.h The macOS support that used it has been removed for a while --- Limelight/Database/DataManager.m | 5 ++-- Limelight/Input/StreamView.h | 4 ++-- Limelight/Limelight-Prefix.pch | 1 - Limelight/Network/AppAssetResponse.m | 4 ++-- Limelight/OSPortabilityDefs.h | 24 ------------------- Limelight/Stream/StreamManager.h | 2 +- Limelight/Stream/StreamManager.m | 4 ++-- Limelight/Stream/VideoDecoderRenderer.h | 2 +- Limelight/Stream/VideoDecoderRenderer.m | 2 +- .../StreamFrameViewController.m | 4 ++-- Moonlight.xcodeproj/project.pbxproj | 2 -- 11 files changed, 13 insertions(+), 41 deletions(-) delete mode 100644 Limelight/OSPortabilityDefs.h diff --git a/Limelight/Database/DataManager.m b/Limelight/Database/DataManager.m index ac61664..a4049a9 100644 --- a/Limelight/Database/DataManager.m +++ b/Limelight/Database/DataManager.m @@ -21,12 +21,11 @@ // HACK: Avoid calling [UIApplication delegate] off the UI thread to keep // Main Thread Checker happy. if ([NSThread isMainThread]) { - _appDelegate = (AppDelegate *)[[OSApplication sharedApplication] delegate]; - + _appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; } else { dispatch_sync(dispatch_get_main_queue(), ^{ - self->_appDelegate = (AppDelegate *)[[OSApplication sharedApplication] delegate]; + self->_appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; }); } diff --git a/Limelight/Input/StreamView.h b/Limelight/Input/StreamView.h index d34d836..ab83d81 100644 --- a/Limelight/Input/StreamView.h +++ b/Limelight/Input/StreamView.h @@ -25,9 +25,9 @@ @end #if TARGET_OS_TV -@interface StreamView : OSView +@interface StreamView : UIView #else -@interface StreamView : OSView +@interface StreamView : UIView #endif @property (nonatomic, retain) IBOutlet UITextField* keyInputField; diff --git a/Limelight/Limelight-Prefix.pch b/Limelight/Limelight-Prefix.pch index a945904..4e945b8 100644 --- a/Limelight/Limelight-Prefix.pch +++ b/Limelight/Limelight-Prefix.pch @@ -21,5 +21,4 @@ #import #import #import "Logger.h" -#include "OSPortabilityDefs.h" #endif diff --git a/Limelight/Network/AppAssetResponse.m b/Limelight/Network/AppAssetResponse.m index fce1e09..0fb9ff8 100644 --- a/Limelight/Network/AppAssetResponse.m +++ b/Limelight/Network/AppAssetResponse.m @@ -16,8 +16,8 @@ self.statusMessage = @"App asset has no status message"; self.statusCode = -1; } -- (OSImage*) getImage { - return [[OSImage alloc] initWithData:self.data]; +- (UIImage*) getImage { + return [[UIImage alloc] initWithData:self.data]; } @end diff --git a/Limelight/OSPortabilityDefs.h b/Limelight/OSPortabilityDefs.h deleted file mode 100644 index 8767c9b..0000000 --- a/Limelight/OSPortabilityDefs.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// OSPortabilityDefs.h -// Moonlight -// -// Created by Cameron Gutman on 3/26/18. -// Copyright © 2018 Moonlight Stream. All rights reserved. -// - -#ifndef OSPortabilityDefs_h -#define OSPortabilityDefs_h - -#if TARGET_OS_IPHONE -#define OSImage UIImage -#define OSColor UIColor -#define OSView UIView -#define OSApplication UIApplication -#else -#define OSImage NSImage -#define OSColor NSColor -#define OSView NSView -#define OSApplication NSApplication -#endif - -#endif /* OSPortabilityDefs_h */ diff --git a/Limelight/Stream/StreamManager.h b/Limelight/Stream/StreamManager.h index 806b4d4..277d6fe 100644 --- a/Limelight/Stream/StreamManager.h +++ b/Limelight/Stream/StreamManager.h @@ -11,7 +11,7 @@ @interface StreamManager : NSOperation -- (id) initWithConfig:(StreamConfiguration*)config renderView:(OSView*)view connectionCallbacks:(id)callback; +- (id) initWithConfig:(StreamConfiguration*)config renderView:(UIView*)view connectionCallbacks:(id)callback; - (void) stopStream; diff --git a/Limelight/Stream/StreamManager.m b/Limelight/Stream/StreamManager.m index 734d89b..a79ec46 100644 --- a/Limelight/Stream/StreamManager.m +++ b/Limelight/Stream/StreamManager.m @@ -20,12 +20,12 @@ @implementation StreamManager { StreamConfiguration* _config; - OSView* _renderView; + UIView* _renderView; id _callbacks; Connection* _connection; } -- (id) initWithConfig:(StreamConfiguration*)config renderView:(OSView*)view connectionCallbacks:(id)callbacks { +- (id) initWithConfig:(StreamConfiguration*)config renderView:(UIView*)view connectionCallbacks:(id)callbacks { self = [super init]; _config = config; _renderView = view; diff --git a/Limelight/Stream/VideoDecoderRenderer.h b/Limelight/Stream/VideoDecoderRenderer.h index e29f19a..b15a82d 100644 --- a/Limelight/Stream/VideoDecoderRenderer.h +++ b/Limelight/Stream/VideoDecoderRenderer.h @@ -10,7 +10,7 @@ @interface VideoDecoderRenderer : NSObject -- (id)initWithView:(OSView*)view; +- (id)initWithView:(UIView*)view; - (void)setupWithVideoFormat:(int)videoFormat refreshRate:(int)refreshRate; diff --git a/Limelight/Stream/VideoDecoderRenderer.m b/Limelight/Stream/VideoDecoderRenderer.m index 8dcddab..8ae7388 100644 --- a/Limelight/Stream/VideoDecoderRenderer.m +++ b/Limelight/Stream/VideoDecoderRenderer.m @@ -30,7 +30,7 @@ displayLayer = [[AVSampleBufferDisplayLayer alloc] init]; displayLayer.bounds = _view.bounds; - displayLayer.backgroundColor = [OSColor blackColor].CGColor; + displayLayer.backgroundColor = [UIColor blackColor].CGColor; displayLayer.position = CGPointMake(CGRectGetMidX(_view.bounds), CGRectGetMidY(_view.bounds)); displayLayer.videoGravity = AVLayerVideoGravityResizeAspect; diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m index 20e3468..3ac7448 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.m +++ b/Limelight/ViewControllers/StreamFrameViewController.m @@ -151,8 +151,8 @@ [_overlayView setTextAlignment:NSTextAlignmentCenter]; } - [_overlayView setTextColor:[OSColor lightGrayColor]]; - [_overlayView setBackgroundColor:[OSColor blackColor]]; + [_overlayView setTextColor:[UIColor lightGrayColor]]; + [_overlayView setBackgroundColor:[UIColor blackColor]]; #if TARGET_OS_TV [_overlayView setFont:[UIFont systemFontOfSize:24]]; #else diff --git a/Moonlight.xcodeproj/project.pbxproj b/Moonlight.xcodeproj/project.pbxproj index 6f4ab26..369d72d 100644 --- a/Moonlight.xcodeproj/project.pbxproj +++ b/Moonlight.xcodeproj/project.pbxproj @@ -176,7 +176,6 @@ 9865DC3B2132922E0005B9B9 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS11.4.sdk/System/Library/Frameworks/GameController.framework; sourceTree = DEVELOPER_DIR; }; 986CCE6C2133E45300168291 /* Moonlight v1.2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Moonlight v1.2.xcdatamodel"; sourceTree = ""; }; 98783FEA242EAC5D00F00EF4 /* Moonlight v1.5.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Moonlight v1.5.xcdatamodel"; sourceTree = ""; }; - 98878AE0206A226D00586E90 /* OSPortabilityDefs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSPortabilityDefs.h; sourceTree = ""; }; 9890CF6A203B7EE1006C4B06 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; }; 9896219623D15C7000211983 /* X1Kit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = X1Kit.swift; path = X1Kit/Sources/X1Kit/X1Kit.swift; sourceTree = ""; }; 9897B6A0221260EF00966419 /* Controller.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = ""; }; @@ -502,7 +501,6 @@ FB1D59961BBCCB6400F482CA /* ComputerScrollView.m */, FB1D59981BBCCD7E00F482CA /* AppCollectionView.h */, FB1D59991BBCCD7E00F482CA /* AppCollectionView.m */, - 98878AE0206A226D00586E90 /* OSPortabilityDefs.h */, ); name = Moonlight; path = Limelight;