diff --git a/ChangeLog b/ChangeLog index 703f506f5..01e35d79c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2005-06-17 Richard Frith-Macdonald + + * Source/NSConnection.m: Removed bogus + NSConnection(ConnectionDelegate) category .. these methods must not be + implemented in NSObject. I hope that removing the concrete + implementation of the category from the Object class will not cause + problems (I believe there used to be problems with older versions of + the compiler if we tried to use @selector(NN) where NN was not + implemented in the same code unit, but I can't remember what the + problems were and when they occurred). + * Headers/Foundation/NSConnection.h: Added comments/documentation from + NSConnection.h + 2005-06-17 Adam Fedor * Remove objc/Protocol.h include from NSObject to avoid warnings diff --git a/Headers/Foundation/NSConnection.h b/Headers/Foundation/NSConnection.h index 2d0fe9309..f9c7b281e 100644 --- a/Headers/Foundation/NSConnection.h +++ b/Headers/Foundation/NSConnection.h @@ -214,51 +214,91 @@ GS_EXPORT NSString* const NSConnectionProxyCount; /* Objects received */ @end - -@interface NSObject (NSConnectionDelegate) /** - * This method may be used to ask a delegate's permission to create - * a new connection from the old one. - * This method should be implemented in preference to the - * [makeNewConnection:sender:] which is obsolete. + * This category represents an informal protocol to which NSConnection + * delegates may conform ... These methods are not actually implemented + * by NSObject, so implementing these methods in your class has the effect + * documented. */ -- (BOOL) connection: (NSConnection*)parent - shouldMakeNewConnection: (NSConnection*)newConnection; +@interface NSObject (NSConnectionDelegate) /** - * This is the old way of doing the same thing as - * [connection:shouldMakeNewConnection:] - * It is obsolete - don't use it. + *

+ * This is not an NSConnection method, but is a method that may + * be implemented by the delegate of an NSConnection object. + *

+ *

+ * If the delegate implements this method, the NSConnection will + * invoke the method for every message request or reply it receives + * from the remote NSConnection. The delegate should use the + * authentication data to check all the NSData objects + * in the components array (ignoring NSPort objects), + * and return YES if they are valid, NO otherwise. + *

+ *

+ * If the method returns NO then an + * NSFailedAuthentication exception will be raised. + *

+ *

+ * In GNUstep the components array is mutable, allowing + * you to replace the NSData objects with your own version. + *

*/ -- (BOOL) makeNewConnection: (NSConnection*)newConnection - sender: (NSConnection*)parent; - -/** - * If the delegate responds to this method, it will be used to ask the - * delegate's permission to establish a new connection from the old one. - * Often this is used so that the delegate can register for invalidation - * notification on new child connections. - * This is a GNUstep extension - * Normally return newConn. - */ -- (NSConnection*) connection: (NSConnection*)ancestorConn - didConnect: (NSConnection*)newConn; - -/** - * These are like the MacOS-X delegate methods, except that we provide the - * components in mutable arrays, so that the delegate can alter the data - * items in the array. Of course, you must do that WITH CARE. - */ - (BOOL) authenticateComponents: (NSMutableArray*)components withData: (NSData*)authenticationData; /** - * These are like the MacOS-X delegate methods, except that we provide the - * components in mutable arrays, so that the delegate can alter the data - * items in the array. Of course, you must do that WITH CARE. - */ + *

+ * This is not an NSConnection method, but is a method that may + * be implemented by the delegate of an NSConnection object. + *

+ *

+ * If the delegate implements this method, the NSConnection will + * invoke the method for every message request ro reply it sends + * to the remote NSConnection. The delegate should generate + * authentication data by examining all the NSData objects + * in the components array (ignoring NSPort objects), + * and return the authentication data that can be used by the + * remote NSConnection. + *

+ *

+ * If the method returns nil then an + * NSGenericException exception will be raised. + *

+ *

+ * In GNUstep the components array is mutable, allowing + * you to replace the NSData objects with your own version. + *

+ */ - (NSData*) authenticationDataForComponents: (NSMutableArray*)components; +/** + *

+ * This is not an NSConnection method, but is a method that may + * be implemented by the delegate of an NSConnection object. + *

+ *

+ * If the delegate implements this method, it will be called + * whenever a new NSConnection is created that has this + * NSConnection as its parent. The delegate may take this + * opportunity to adjust the configuration of the new + * connection and may return a boolean value to tell the + * parent whether the creation of the new connection is to + * be permitted or not. + *

+ */ + - (BOOL) connection: (NSConnection*)parent + shouldMakeNewConnection: (NSConnection*)newConnection; + +- (NSConnection*) connection: (NSConnection*)ancestorConn + didConnect: (NSConnection*)newConn; + +/** + * An old fashioned synonym for -connection:shouldMakeNewConnection: - + * don't use this. + */ +- (BOOL) makeNewConnection: (NSConnection*)newConnection + sender: (NSConnection*)parent; @end /** diff --git a/Source/NSConnection.m b/Source/NSConnection.m index 8e8dbda6a..750cb6b5c 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -3585,105 +3585,3 @@ static void callEncoder (DOContext *ctxt) @end - - -/** - * This category represents an informal protocol to which NSConnection - * delegates may conform ... implementing these methods has the effect - * documented. - */ -@implementation NSObject (NSConnectionDelegate) -/** - *

- * This is not an NSConnection method, but is a method that may - * be implemented by the delegate of an NSConnection object. - *

- *

- * If the delegate implements this method, the NSConnection will - * invoke the method for every message request or reply it receives - * from the remote NSConnection. The delegate should use the - * authentication data to check all the NSData objects - * in the components array (ignoring NSPort objects), - * and return YES if they are valid, NO otherwise. - *

- *

- * If the method returns NO then an - * NSFailedAuthentication exception will be raised. - *

- *

- * In GNUstep the components array is mutable, allowing - * you to replace the NSData objects with your own version. - *

- */ -- (BOOL) authenticateComponents: (NSMutableArray*)components - withData: (NSData*)authenticationData -{ - return NO; -} - -/** - *

- * This is not an NSConnection method, but is a method that may - * be implemented by the delegate of an NSConnection object. - *

- *

- * If the delegate implements this method, the NSConnection will - * invoke the method for every message request ro reply it sends - * to the remote NSConnection. The delegate should generate - * authentication data by examining all the NSData objects - * in the components array (ignoring NSPort objects), - * and return the authentication data that can be used by the - * remote NSConnection. - *

- *

- * If the method returns nil then an - * NSGenericException exception will be raised. - *

- *

- * In GNUstep the components array is mutable, allowing - * you to replace the NSData objects with your own version. - *

- */ -- (NSData*) authenticationDataForComponents: (NSMutableArray*)components -{ - return nil; -} - -/** - *

- * This is not an NSConnection method, but is a method that may - * be implemented by the delegate of an NSConnection object. - *

- *

- * If the delegate implements this method, it will be called - * whenever a new NSConnection is created that has this - * NSConnection as its parent. The delegate may take this - * opportunity to adjust the configuration of the new - * connection and may return a boolean value to tell the - * parent whether the creation of the new connection is to - * be permitted or not. - *

- */ - - (BOOL) connection: (NSConnection*)parent - shouldMakeNewConnection: (NSConnection*)newConnection -{ - return NO; -} - -- (NSConnection*) connection: (NSConnection*)ancestorConn - didConnect: (NSConnection*)newConn -{ - return nil; -} - -/** - * An old fashioned synonym for -connection:shouldMakeNewConnection: - - * don't use this. - */ -- (BOOL) makeNewConnection: (NSConnection*)newConnection - sender: (NSConnection*)parent -{ - return NO; -} -@end -