1995-03-12 15:50:58 +00:00
|
|
|
/* Interface for NSObject for GNUStep
|
1998-11-02 10:23:56 +00:00
|
|
|
Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
|
1995-07-01 19:01:11 +00:00
|
|
|
|
1996-04-17 20:17:45 +00:00
|
|
|
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
|
1995-07-01 19:01:11 +00:00
|
|
|
Date: 1995
|
1995-03-12 15:50:58 +00:00
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
1995-03-12 15:50:58 +00:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#ifndef __NSObject_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSObject_h_GNUSTEP_BASE_INCLUDE
|
1994-11-08 16:44:01 +00:00
|
|
|
|
1998-11-02 10:23:56 +00:00
|
|
|
/*
|
|
|
|
* Check consistency of definitions for system compatibility.
|
|
|
|
*/
|
|
|
|
#if defined(STRICT_OpenStep)
|
|
|
|
#define NO_GNUSTEP 1
|
|
|
|
#elif defined(STRICT_MacOS_X)
|
|
|
|
#define NO_GNUSTEP 1
|
|
|
|
#else
|
|
|
|
#undef NO_GNUSTEP
|
|
|
|
#endif
|
|
|
|
|
1994-11-08 16:44:01 +00:00
|
|
|
#include <objc/objc.h>
|
|
|
|
#include <objc/Protocol.h>
|
1995-04-17 21:13:20 +00:00
|
|
|
#include <Foundation/NSZone.h>
|
1997-09-13 17:52:31 +00:00
|
|
|
#include <gnustep/base/fake-main.h>
|
1995-03-12 15:50:58 +00:00
|
|
|
|
|
|
|
@class NSArchiver;
|
1998-04-02 14:27:40 +00:00
|
|
|
@class NSArray;
|
1995-03-12 15:50:58 +00:00
|
|
|
@class NSCoder;
|
1997-09-01 21:59:51 +00:00
|
|
|
@class NSPortCoder;
|
1995-03-12 15:50:58 +00:00
|
|
|
@class NSMethodSignature;
|
1997-09-13 17:52:31 +00:00
|
|
|
@class NSRecursiveLock;
|
1995-03-12 15:50:58 +00:00
|
|
|
@class NSString;
|
|
|
|
@class NSInvocation;
|
|
|
|
@class Protocol;
|
|
|
|
|
|
|
|
@protocol NSObject
|
|
|
|
- (Class) class;
|
1998-09-28 20:38:02 +00:00
|
|
|
- (Class) superclass;
|
1995-03-12 15:50:58 +00:00
|
|
|
- (BOOL) isEqual: anObject;
|
|
|
|
- (BOOL) isKindOfClass: (Class)aClass;
|
|
|
|
- (BOOL) isMemberOfClass: (Class)aClass;
|
|
|
|
- (BOOL) isProxy;
|
1998-09-28 20:38:02 +00:00
|
|
|
- (unsigned) hash;
|
|
|
|
- self;
|
|
|
|
- performSelector: (SEL)aSelector;
|
|
|
|
- performSelector: (SEL)aSelector withObject: anObject;
|
|
|
|
- performSelector: (SEL)aSelector withObject: object1 withObject: object2;
|
1995-03-12 15:50:58 +00:00
|
|
|
- (BOOL) respondsToSelector: (SEL)aSelector;
|
1998-09-28 20:38:02 +00:00
|
|
|
- (BOOL) conformsToProtocol: (Protocol *)aProtocol;
|
1995-03-12 15:50:58 +00:00
|
|
|
- retain;
|
1998-09-28 20:38:02 +00:00
|
|
|
- autorelease;
|
|
|
|
- (oneway void) release;
|
1995-03-12 15:50:58 +00:00
|
|
|
- (unsigned) retainCount;
|
1996-02-22 16:00:04 +00:00
|
|
|
- (NSZone *) zone;
|
|
|
|
- (NSString *) description;
|
1995-03-12 15:50:58 +00:00
|
|
|
@end
|
1994-11-08 16:44:01 +00:00
|
|
|
|
1995-03-12 15:50:58 +00:00
|
|
|
@protocol NSCopying
|
1998-07-15 12:43:56 +00:00
|
|
|
- (id) copyWithZone: (NSZone *)zone;
|
1995-03-12 15:50:58 +00:00
|
|
|
@end
|
1994-11-08 16:44:01 +00:00
|
|
|
|
1995-03-12 15:50:58 +00:00
|
|
|
@protocol NSMutableCopying
|
1998-07-15 12:43:56 +00:00
|
|
|
- (id) mutableCopyWithZone: (NSZone *)zone;
|
1995-03-12 15:50:58 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol NSCoding
|
1995-04-09 02:06:39 +00:00
|
|
|
- (void) encodeWithCoder: (NSCoder*)aCoder;
|
|
|
|
- (id) initWithCoder: (NSCoder*)aDecoder;
|
1995-03-12 15:50:58 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
1998-07-15 12:43:56 +00:00
|
|
|
@interface NSObject <NSObject>
|
1994-11-08 16:44:01 +00:00
|
|
|
{
|
1995-03-12 15:50:58 +00:00
|
|
|
Class isa;
|
1994-11-08 16:44:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (void) initialize;
|
|
|
|
+ (id) allocWithZone: (NSZone*)z;
|
1995-03-12 15:50:58 +00:00
|
|
|
+ (id) alloc;
|
1994-11-08 16:44:01 +00:00
|
|
|
+ (id) new;
|
|
|
|
- (id) copy;
|
|
|
|
- (void) dealloc;
|
|
|
|
- (id) init;
|
|
|
|
- (id) mutableCopy;
|
|
|
|
|
1998-09-28 20:38:02 +00:00
|
|
|
+ (Class) class;
|
|
|
|
+ (Class) superclass;
|
1994-11-08 16:44:01 +00:00
|
|
|
|
|
|
|
+ (BOOL) instancesRespondToSelector: (SEL)aSelector;
|
|
|
|
|
|
|
|
+ (IMP) instanceMethodForSelector: (SEL)aSelector;
|
|
|
|
- (IMP) methodForSelector: (SEL)aSelector;
|
1998-07-15 16:33:33 +00:00
|
|
|
+ (NSMethodSignature*) instanceMethodSignatureForSelector: (SEL)aSelector;
|
1994-11-08 16:44:01 +00:00
|
|
|
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector;
|
|
|
|
|
1995-03-12 15:50:58 +00:00
|
|
|
- (NSString*) description;
|
1994-11-08 16:44:01 +00:00
|
|
|
+ (NSString*) description;
|
|
|
|
|
|
|
|
+ (void) poseAsClass: (Class)aClass;
|
|
|
|
|
|
|
|
- (void) doesNotRecognizeSelector: (SEL)aSelector;
|
|
|
|
|
|
|
|
- (void) forwardInvocation: (NSInvocation*)anInvocation;
|
|
|
|
|
1995-03-12 15:50:58 +00:00
|
|
|
- (id) awakeAfterUsingCoder: (NSCoder*)aDecoder;
|
1998-10-11 06:26:40 +00:00
|
|
|
- (Class) classForArchiver;
|
1994-11-08 16:44:01 +00:00
|
|
|
- (Class) classForCoder;
|
1998-10-11 06:26:40 +00:00
|
|
|
- (Class) classForPortCoder;
|
1998-10-22 10:02:39 +00:00
|
|
|
- (id) replacementObjectForArchiver: (NSArchiver*)anEncoder;
|
1994-11-08 16:44:01 +00:00
|
|
|
- (id) replacementObjectForCoder: (NSCoder*)anEncoder;
|
1998-10-11 06:26:40 +00:00
|
|
|
- (id) replacementObjectForPortCoder: (NSPortCoder*)anEncoder;
|
|
|
|
|
1994-11-08 16:44:01 +00:00
|
|
|
|
1998-09-28 20:38:02 +00:00
|
|
|
+ setVersion: (int)aVersion;
|
|
|
|
+ (int) version;
|
|
|
|
|
1994-11-08 16:44:01 +00:00
|
|
|
@end
|
|
|
|
|
1995-03-12 15:50:58 +00:00
|
|
|
NSObject *NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone);
|
|
|
|
void NSDeallocateObject(NSObject *anObject);
|
|
|
|
NSObject *NSCopyObject(NSObject *anObject, unsigned extraBytes, NSZone *zone);
|
1995-04-09 02:06:39 +00:00
|
|
|
|
1995-03-12 15:50:58 +00:00
|
|
|
BOOL NSShouldRetainWithZone(NSObject *anObject, NSZone *requestedZone);
|
|
|
|
void NSIncrementExtraRefCount(id anObject);
|
|
|
|
BOOL NSDecrementExtraRefCountWasZero(id anObject);
|
|
|
|
|
|
|
|
typedef enum _NSComparisonResult
|
|
|
|
{
|
|
|
|
NSOrderedAscending = -1, NSOrderedSame, NSOrderedDescending
|
|
|
|
}
|
|
|
|
NSComparisonResult;
|
|
|
|
|
|
|
|
enum {NSNotFound = 0x7fffffff};
|
|
|
|
|
1995-03-12 19:34:43 +00:00
|
|
|
@interface NSObject (NEXTSTEP)
|
1995-03-12 15:50:58 +00:00
|
|
|
- error:(const char *)aString, ...;
|
|
|
|
- notImplemented:(SEL)aSel;
|
1996-03-03 00:35:05 +00:00
|
|
|
/* - (const char *) name;
|
|
|
|
Removed because OpenStep has -(NSString*)name; */
|
1995-03-12 19:34:43 +00:00
|
|
|
@end
|
|
|
|
|
1998-11-02 10:23:56 +00:00
|
|
|
#ifndef NO_GNUSTEP
|
|
|
|
/* Global lock to be used by classes when operating on any global
|
|
|
|
data that invoke other methods which also access global; thus,
|
|
|
|
creating the potential for deadlock. */
|
|
|
|
extern NSRecursiveLock *gnustep_global_lock;
|
|
|
|
|
1995-03-12 19:34:43 +00:00
|
|
|
@interface NSObject (GNU)
|
1995-03-23 03:33:07 +00:00
|
|
|
- (int) compare: anObject;
|
1995-03-12 19:34:43 +00:00
|
|
|
- (Class)transmuteClassTo:(Class)aClassObject;
|
|
|
|
- subclassResponsibility:(SEL)aSel;
|
|
|
|
- shouldNotImplement:(SEL)aSel;
|
1995-03-23 03:33:07 +00:00
|
|
|
+ (Class) autoreleaseClass;
|
|
|
|
+ (void) setAutoreleaseClass: (Class)aClass;
|
1995-08-04 20:53:05 +00:00
|
|
|
+ (void) enableDoubleReleaseCheck: (BOOL)enable;
|
1995-03-23 03:33:07 +00:00
|
|
|
- read: (TypedStream*)aStream;
|
|
|
|
- write: (TypedStream*)aStream;
|
1995-03-12 15:50:58 +00:00
|
|
|
@end
|
1998-11-02 10:23:56 +00:00
|
|
|
#endif
|
1995-03-12 15:50:58 +00:00
|
|
|
|
1998-04-02 14:27:40 +00:00
|
|
|
#include <Foundation/NSDate.h>
|
|
|
|
@interface NSObject (TimedPerformers)
|
|
|
|
+ (void) cancelPreviousPerformRequestsWithTarget: (id)obj
|
|
|
|
selector: (SEL)s
|
|
|
|
object: (id)arg;
|
|
|
|
- (void) performSelector: (SEL)s
|
|
|
|
withObject: (id)arg
|
|
|
|
afterDelay: (NSTimeInterval)seconds;
|
|
|
|
- (void) performSelector: (SEL)s
|
|
|
|
withObject: (id)arg
|
|
|
|
afterDelay: (NSTimeInterval)seconds
|
|
|
|
inModes: (NSArray*)modes;
|
|
|
|
@end
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#endif /* __NSObject_h_GNUSTEP_BASE_INCLUDE */
|