OS X: Move away from ivars in headers, beginning with the main app.

Also have NSString properties be declared with copy, as recommended by Apple.

git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@92226 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
SND\MaddTheSane_cp 2014-11-10 19:46:07 +00:00
parent 264fac97c4
commit 0f8e66e194
15 changed files with 57 additions and 57 deletions

View File

@ -11,20 +11,18 @@ extern NSString *const memCardChangeNumberKey;
@class PcsxrMemCardController; @class PcsxrMemCardController;
@interface ConfigurationController : NSWindowController <NSWindowDelegate, NSTabViewDelegate> @interface ConfigurationController : NSWindowController <NSWindowDelegate, NSTabViewDelegate>
{ @property (weak) IBOutlet PluginController *cdromPlugin;
IBOutlet PluginController *cdromPlugin; @property (weak) IBOutlet PluginController *graphicsPlugin;
IBOutlet PluginController *graphicsPlugin; @property (weak) IBOutlet PluginController *padPlugin;
IBOutlet PluginController *padPlugin; @property (weak) IBOutlet PluginController *soundPlugin;
IBOutlet PluginController *soundPlugin; @property (weak) IBOutlet PluginController *netPlugin;
IBOutlet PluginController *netPlugin; @property (weak) IBOutlet PluginController *sio1Plugin;
IBOutlet PluginController *sio1Plugin;
@property (weak) IBOutlet PcsxrMemCardController *memCardEdit;
IBOutlet PcsxrMemCardController *memCardEdit;
// Hotkeys
// Hotkeys @property (weak) IBOutlet HotkeyController *hkController;
IBOutlet HotkeyController *hkController; @property (weak) IBOutlet NSTabViewItem *hkTab;
IBOutlet NSTabViewItem *hkTab;
}
@property (weak) IBOutlet NSButtonCell *noXaAudioCell; @property (weak) IBOutlet NSButtonCell *noXaAudioCell;
@property (weak) IBOutlet NSButtonCell *sioIrqAlwaysCell; @property (weak) IBOutlet NSButtonCell *sioIrqAlwaysCell;

View File

@ -32,6 +32,15 @@ NSString *const memCardChangeNumberKey = @"PcsxrMemoryCardThatChangedKey";
@synthesize vSyncWAFixCell; @synthesize vSyncWAFixCell;
@synthesize vTypePALCell; @synthesize vTypePALCell;
@synthesize widescreen; @synthesize widescreen;
@synthesize cdromPlugin;
@synthesize graphicsPlugin;
@synthesize padPlugin;
@synthesize soundPlugin;
@synthesize netPlugin;
@synthesize sio1Plugin;
@synthesize memCardEdit;
@synthesize hkController;
@synthesize hkTab;
+ (void)setMemoryCard:(NSInteger)theCard toURL:(NSURL *)theURL; + (void)setMemoryCard:(NSInteger)theCard toURL:(NSURL *)theURL;
{ {

View File

@ -17,7 +17,6 @@ typedef NS_ENUM(char, EmuThreadPauseStatus) {
@interface EmuThread : NSObject { @interface EmuThread : NSObject {
jmp_buf restartJmp; jmp_buf restartJmp;
BOOL wasPaused;
} }
- (void)EmuThreadRun:(id)anObject; - (void)EmuThreadRun:(id)anObject;

View File

@ -32,6 +32,9 @@ static pthread_cond_t eventCond;
static pthread_mutex_t eventMutex; static pthread_mutex_t eventMutex;
@implementation EmuThread @implementation EmuThread
{
BOOL wasPaused;
}
- (void)setUpThread - (void)setUpThread
{ {

View File

@ -17,7 +17,7 @@ typedef enum _LaunchArgOrder {
@interface LaunchArg : NSObject @interface LaunchArg : NSObject
@property (readonly) unsigned launchOrder; @property (readonly) unsigned launchOrder;
@property (readonly, copy, nonatomic) dispatch_block_t theBlock; @property (readonly, copy, nonatomic) dispatch_block_t theBlock;
@property (readonly, strong) NSString *argument; @property (readonly, copy) NSString *argument;
- (instancetype)initWithLaunchOrder:(unsigned)order block:(dispatch_block_t)block argument:(NSString*)arg; - (instancetype)initWithLaunchOrder:(unsigned)order block:(dispatch_block_t)block argument:(NSString*)arg;
- (instancetype)initWithLaunchOrder:(unsigned)order argument:(NSString*)arg block:(dispatch_block_t)block NS_DESIGNATED_INITIALIZER; - (instancetype)initWithLaunchOrder:(unsigned)order argument:(NSString*)arg block:(dispatch_block_t)block NS_DESIGNATED_INITIALIZER;

View File

@ -11,7 +11,7 @@
@interface LaunchArg () @interface LaunchArg ()
@property (readwrite) unsigned launchOrder; @property (readwrite) unsigned launchOrder;
@property (readwrite, copy, nonatomic) dispatch_block_t theBlock; @property (readwrite, copy, nonatomic) dispatch_block_t theBlock;
@property (readwrite, strong) NSString *argument; @property (readwrite, copy) NSString *argument;
@end @end
@implementation LaunchArg @implementation LaunchArg

View File

@ -12,21 +12,8 @@ __private_extern void ShowHelpAndExit(FILE* output, int exitCode);
extern BOOL wasFinderLaunch; extern BOOL wasFinderLaunch;
@interface PcsxrController : NSObject <NSApplicationDelegate> @interface PcsxrController : NSObject <NSApplicationDelegate>
{
ConfigurationController *preferencesController;
CheatController *cheatController;
PluginList *pluginList;
struct _PSXflags {
unsigned int sleepInBackground:1;
unsigned int wasPausedBeforeBGSwitch:1;
unsigned int endAtEmuClose:1;
unsigned int wasPausedBeforeDiscEject:1;
unsigned int reserved:28;
} PSXflags;
}
@property (weak) IBOutlet RecentItemsMenu *recentItems; @property (weak) IBOutlet RecentItemsMenu *recentItems;
@property (readonly) CheatController *cheatController; @property (strong, readonly) CheatController *cheatController;
@property (readonly) BOOL endAtEmuClose; @property (readonly) BOOL endAtEmuClose;
- (IBAction)ejectCD:(id)sender; - (IBAction)ejectCD:(id)sender;

View File

@ -63,9 +63,21 @@ void ShowHelpAndExit(FILE* output, int exitCode)
@property (strong) NSWindow *preferenceWindow; @property (strong) NSWindow *preferenceWindow;
@property (strong) NSWindow *cheatWindow; @property (strong) NSWindow *cheatWindow;
@property (nonatomic) DASessionRef diskSession; @property (nonatomic) DASessionRef diskSession;
@property (strong, readwrite) CheatController *cheatController;
@end @end
@implementation PcsxrController @implementation PcsxrController
{
ConfigurationController *preferencesController;
PluginList *pluginList;
struct _PSXflags {
unsigned int sleepInBackground:1;
unsigned int wasPausedBeforeBGSwitch:1;
unsigned int endAtEmuClose:1;
unsigned int wasPausedBeforeDiscEject:1;
unsigned int reserved:28;
} PSXflags;
}
@synthesize recentItems; @synthesize recentItems;
@synthesize skipFiles; @synthesize skipFiles;
@synthesize cheatController; @synthesize cheatController;

View File

@ -16,18 +16,7 @@
- (void)deleteMemoryBlocksAtIndex:(int)slotnum; - (void)deleteMemoryBlocksAtIndex:(int)slotnum;
- (void)compactMemory; - (void)compactMemory;
/**
* @fn freeBlocks
* @abstract Blocks that are free from any data
* @result free blocks
*/
@property (readonly) int freeBlocks; @property (readonly) int freeBlocks;
/**
* @fn availableBlocks
* @abstract Blocks that have been deleted
* @result free blocks
*/
@property (readonly) int availableBlocks; @property (readonly) int availableBlocks;
- (int)memorySizeAtIndex:(int)idx; - (int)memorySizeAtIndex:(int)idx;
- (BOOL)moveBlockAtIndex:(int)idx toMemoryCard:(PcsxrMemCardArray*)otherCard; - (BOOL)moveBlockAtIndex:(int)idx toMemoryCard:(PcsxrMemCardArray*)otherCard;

View File

@ -10,12 +10,11 @@
@class PcsxrMemCardArray; @class PcsxrMemCardArray;
@interface PcsxrMemCardController : NSViewController @interface PcsxrMemCardController : NSViewController
{ @property (weak) IBOutlet NSCollectionView *memCard1view;
IBOutlet NSCollectionView *memCard1view; @property (weak) IBOutlet NSCollectionView *memCard2view;
IBOutlet NSCollectionView *memCard2view; @property (weak) IBOutlet NSTextField *memCard1Label;
IBOutlet NSTextField *memCard1Label; @property (weak) IBOutlet NSTextField *memCard2Label;
IBOutlet NSTextField *memCard2Label;
}
@property (readonly, strong) PcsxrMemCardArray *memCard1Array; @property (readonly, strong) PcsxrMemCardArray *memCard1Array;
@property (readonly, strong) PcsxrMemCardArray *memCard2Array; @property (readonly, strong) PcsxrMemCardArray *memCard2Array;

View File

@ -23,6 +23,10 @@
@implementation PcsxrMemCardController @implementation PcsxrMemCardController
@synthesize memCard1Array; @synthesize memCard1Array;
@synthesize memCard2Array; @synthesize memCard2Array;
@synthesize memCard1view;
@synthesize memCard2view;
@synthesize memCard1Label;
@synthesize memCard2Label;
- (void)setupValues:(int)theCards - (void)setupValues:(int)theCards
{ {

View File

@ -28,9 +28,9 @@ typedef NS_ENUM(char, PCSXRMemFlags) {
- (NSImage*)memoryImageAtIndex:(NSInteger)idx; - (NSImage*)memoryImageAtIndex:(NSInteger)idx;
@property (readonly, strong) NSString *name; @property (readonly, copy) NSString *name;
@property (readonly, strong) NSString *memName; @property (readonly, copy) NSString *memName;
@property (readonly, strong) NSString *memID; @property (readonly, copy) NSString *memID;
@property (readonly, strong) NSArray *memoryCardImages; @property (readonly, strong) NSArray *memoryCardImages;
@property (readonly, strong, nonatomic) NSImage *memImage; @property (readonly, strong, nonatomic) NSImage *memImage;
@property (readonly) PCSXRMemFlags flagNameIndex; @property (readonly) PCSXRMemFlags flagNameIndex;

View File

@ -10,9 +10,9 @@
#import "PcsxrMemoryObject.h" #import "PcsxrMemoryObject.h"
@interface PcsxrMemoryObject () @interface PcsxrMemoryObject ()
@property (readwrite, strong) NSString *name; @property (readwrite, copy) NSString *name;
@property (readwrite, strong) NSString *memName; @property (readwrite, copy) NSString *memName;
@property (readwrite, strong) NSString *memID; @property (readwrite, copy) NSString *memID;
@property (readwrite) uint8_t startingIndex; @property (readwrite) uint8_t startingIndex;
@property (readwrite) uint8_t blockSize; @property (readwrite) uint8_t blockSize;

View File

@ -10,7 +10,7 @@
@interface PcsxrPlugin : NSObject @interface PcsxrPlugin : NSObject
@property (readonly, copy) NSString *path; @property (readonly, copy) NSString *path;
@property (readonly, strong) NSString *name; @property (readonly, copy) NSString *name;
@property (readonly) int type; @property (readonly) int type;
+ (NSString *)prefixForType:(int)type; + (NSString *)prefixForType:(int)type;

View File

@ -17,9 +17,9 @@
@interface PcsxrPlugin () @interface PcsxrPlugin ()
@property (readwrite, copy) NSString *path; @property (readwrite, copy) NSString *path;
@property (readwrite, strong) NSString *name; @property (readwrite, copy) NSString *name;
@property (strong) NSDate *modDate; @property (strong) NSDate *modDate;
@property (strong) NSString *fullPlugPath; @property (copy) NSString *fullPlugPath;
@property long version; @property long version;
@property (readwrite) int type; @property (readwrite) int type;
@property int active; @property int active;