forked from stevestreza/XPCKit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a79d76
commit a18c9d1
Showing
8 changed files
with
368 additions
and
16 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
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
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
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
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 |
---|---|---|
|
@@ -25,3 +25,4 @@ | |
|
||
#import "XPCConnection.h" | ||
#import "XPCService.h" | ||
#import "XPCProxy.h" |
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,51 @@ | ||
// | ||
// XPCProxy.h | ||
// XPCKit | ||
// | ||
// Created by Brian King on 2/25/12. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "XPCConnection.h" | ||
|
||
|
||
|
||
@interface XPCProxy : NSObject | ||
{ | ||
Class _proxyClass; | ||
XPCConnection *_connection; | ||
NSMutableDictionary *_definition; | ||
} | ||
/* | ||
* Name an object in the service to expose objects to those connecting. | ||
*/ | ||
+ (void)registerProxy:(NSObject *)object named:(NSString *)named; | ||
|
||
/* | ||
* Return a proxy for the class represented by Class with the selector method. IE: | ||
* | ||
* p = [XPCProxy proxyClass:@"ClassName" | ||
* selector:@selector(singletonSelector) | ||
* onConnection:_connection]; | ||
* | ||
* BOOL b = [p methodWithDate:date integer:i andArray:a]; | ||
* | ||
* This will serialize the NSInvocation into dictionaries, and send the dictionary over the connection. | ||
* On the service, it will deserialize into an NSInvocation, call [ClassName singletonSelector], and then | ||
* invoke the invocation on the result. | ||
* | ||
*/ | ||
+ (id)proxyClass:(NSString *)className selector:(SEL)method onConnection:(XPCConnection *)connection; | ||
|
||
|
||
/* | ||
* Same as above but with named lookup | ||
*/ | ||
+ (id)proxyClass:(NSString *)className named:(NSString *)name onConnection:(XPCConnection *)connection; | ||
|
||
|
||
|
||
// Call this method in the event handler of the service | ||
+ (void)handleInvocationOfProxyMessage:(NSDictionary *)proxy fromConnection:(XPCConnection *)connection; | ||
|
||
@end |
Oops, something went wrong.