Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filesystems can now be mounted. Parameter processing still hacked tog…
…ether. UI (Prefpane) and IPC skeletons now in place.
- Loading branch information
Michael Gorbach
committed
Dec 9, 2007
1 parent
bd49ecf
commit 734747a
Showing
24 changed files
with
1,064 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// MFCommunicationServer.h | ||
// MacFusion2 | ||
// | ||
// Created by Michael Gorbach on 12/7/07. | ||
// Copyright 2007 Michael Gorbach. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "MFServerProtocol.h" | ||
|
||
@class MFFilesystemController, MFPluginController; | ||
|
||
@interface MFCommunicationServer : NSObject <MFServerProtocol> | ||
{ | ||
|
||
} | ||
|
||
+ (MFCommunicationServer*)sharedServer; | ||
|
||
- (MFFilesystemController*)filesystemController; | ||
- (MFPluginController*)pluginController; | ||
- (void)startServingRunloop; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// | ||
// MFCommunicationServer.m | ||
// MacFusion2 | ||
// | ||
// Created by Michael Gorbach on 12/7/07. | ||
// Copyright 2007 Michael Gorbach. All rights reserved. | ||
// | ||
|
||
#import "MFCommunicationServer.h" | ||
#import "MFFilesystemController.h" | ||
#import "MFPluginController.h" | ||
|
||
@implementation MFCommunicationServer | ||
static MFCommunicationServer* sharedServer = nil; | ||
|
||
|
||
+ (MFCommunicationServer*)sharedServer | ||
{ | ||
if (sharedServer == nil) | ||
{ | ||
[[self alloc] init]; | ||
} | ||
|
||
return sharedServer; | ||
} | ||
|
||
+ (MFCommunicationServer*)allocWithZone:(NSZone*)zone | ||
{ | ||
if (sharedServer == nil) | ||
{ | ||
sharedServer = [super allocWithZone: zone]; | ||
return sharedServer; | ||
} | ||
|
||
return nil; | ||
} | ||
|
||
- (void)registerNotifications | ||
{ | ||
NSArray* filesystems = [[self filesystemController] filesystems]; | ||
NSIndexSet* indexes = [NSIndexSet indexSetWithIndexesInRange: | ||
NSMakeRange(0, [filesystems count])]; | ||
[filesystems addObserver:self | ||
toObjectsAtIndexes:indexes | ||
forKeyPath:@"status" | ||
options:NSKeyValueObservingOptionNew | ||
context:nil]; | ||
} | ||
|
||
- (id) init | ||
{ | ||
self = [super init]; | ||
if (self != nil) { | ||
[self registerNotifications]; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)vendDisributedObject | ||
{ | ||
NSConnection* connection = [NSConnection defaultConnection]; | ||
// TODO: Vend a proxy to set up protocol instead of, um , everything | ||
[connection setRootObject:self]; | ||
if ([connection registerName:@"macfusion"] == YES) | ||
{ | ||
MFLogS(self, @"Now Vending distributed object"); | ||
} | ||
else | ||
{ | ||
MFLogS(self, @"Failed to register connection name"); | ||
} | ||
} | ||
|
||
- (void) observeValueForKeyPath:(NSString *)keyPath | ||
ofObject:(id)object | ||
change:(NSDictionary *)change | ||
context:(void *)context | ||
{ | ||
// MFLogS(self, @"Observe triggered on keypath %@, object %@", keyPath, object); | ||
} | ||
|
||
- (MFFilesystemController*)filesystemController | ||
{ | ||
return [MFFilesystemController sharedController]; | ||
} | ||
|
||
- (MFPluginController*)pluginController | ||
{ | ||
return [MFPluginController sharedController]; | ||
} | ||
|
||
- (void)startServingRunloop | ||
{ | ||
[self vendDisributedObject]; | ||
[[NSRunLoop currentRunLoop] run]; | ||
} | ||
|
||
- (void)sendStatus | ||
{ | ||
MFLogS(self, @"Status send triggered"); | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* MFConstants.h | ||
* MacFusion2 | ||
* | ||
* Created by Michael Gorbach on 12/1/07. | ||
* Copyright 2007 Michael Gorbach. All rights reserved. | ||
* | ||
*/ | ||
|
||
// Status values for filesystems | ||
extern NSString* kMFStatusFSMounted; | ||
extern NSString* kMFStatusFSUnmounted; | ||
extern NSString* kMFStatusFSWaiting; | ||
extern NSString* kMFStatusFSFailed; | ||
|
||
// Notification Names | ||
extern NSString* kMFStatusChangedNotification; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// MFConstants.m | ||
// MacFusion2 | ||
// | ||
// Created by Michael Gorbach on 12/1/07. | ||
// Copyright 2007 Michael Gorbach. All rights reserved. | ||
// | ||
|
||
#import "MFConstants.h" | ||
|
||
NSString* kMFStatusFSMounted = @"Mounted"; | ||
NSString* kMFStatusFSUnmounted = @"Unmounted"; | ||
NSString* kMFStatusFSWaiting = @"Waiting to Mount"; | ||
NSString* kMFStatusFSFailed = @"Failed to Mount"; | ||
|
||
NSString* kMFStatusChangedNotification = @"Status Changed Notification"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.