mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-19 17:50:47 +00:00
update for new objc runtime
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@29958 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
34b5413f0f
commit
601409fef6
5 changed files with 48 additions and 57 deletions
|
@ -1,3 +1,12 @@
|
|||
2010-03-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* EOControl/EONSAddOns.h:
|
||||
* EOControl/EONSAddOns.m:
|
||||
* EOControl/EOKeyValueCoding.m:
|
||||
* EOControl/EOClassDescription.m:
|
||||
Rewrite mechanism to try to ensure that our implementations are used
|
||||
for KVC. New version should work with the objc runtime API.
|
||||
|
||||
2010-03-07 Matt Rice <ratmice@gmail.com>
|
||||
|
||||
* DBModeler/DiagramView.m: Add missing include.
|
||||
|
|
|
@ -739,17 +739,13 @@ fromInsertionInEditingContext: (EOEditingContext *)editingContext
|
|||
|
||||
@end
|
||||
|
||||
|
||||
@implementation NSObject (EOClassDescriptionPrimitives)
|
||||
|
||||
- (void)GDL2CDNSObjectICategoryID
|
||||
{
|
||||
}
|
||||
@interface GDL2CDNSObject : NSObject
|
||||
@end
|
||||
@implementation GDL2CDNSObject
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
GDL2_ActivateCategory("NSObject",
|
||||
@selector(GDL2CDNSObjectICategoryID), YES);
|
||||
GDL2_Activate([self class], YES);
|
||||
}
|
||||
|
||||
// when you enable the NSDebugMLLogs here you will have a loop. dave
|
||||
|
|
|
@ -92,16 +92,13 @@ initialize(void)
|
|||
#define INITIALIZE if (!initialized) initialize();
|
||||
|
||||
|
||||
@implementation NSObject (_EOKeyValueCodingCompatibility)
|
||||
|
||||
- (void)GDL2KVCNSObjectICategoryID
|
||||
{
|
||||
}
|
||||
@interface GDL2KVCNSObject : NSObject
|
||||
@end
|
||||
@implementation GDL2KVCNSObject
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
GDL2_ActivateCategory("NSObject",
|
||||
@selector(GDL2KVCNSObjectICategoryID), YES);
|
||||
GDL2_Activate([self class], YES);
|
||||
}
|
||||
|
||||
|
||||
|
@ -235,16 +232,13 @@ initialize(void)
|
|||
@end
|
||||
|
||||
|
||||
@implementation NSArray (EOKeyValueCoding)
|
||||
|
||||
- (void)GDL2KVCNSArrayICategoryID
|
||||
{
|
||||
}
|
||||
@interface GDL2KVCNSArray : NSArray
|
||||
@end
|
||||
@implementation GDL2KVCNSArray
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
GDL2_ActivateCategory("NSArray",
|
||||
@selector(GDL2KVCNSArrayICategoryID), YES);
|
||||
GDL2_Activate([self class], YES);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -543,16 +537,14 @@ initialize(void)
|
|||
@end
|
||||
|
||||
|
||||
@implementation NSDictionary (EOKeyValueCoding)
|
||||
@interface GDL2KVCNSDictionary : NSDictionary
|
||||
@end
|
||||
@implementation GDL2KVCNSDictionary
|
||||
|
||||
- (void)GDL2KVCNSDictionaryICategoryID
|
||||
{
|
||||
}
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
GDL2_ActivateCategory("NSDictionary",
|
||||
@selector(GDL2KVCNSDictionaryICategoryID), YES);
|
||||
GDL2_Activate([self class], YES);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -851,16 +843,13 @@ initialize(void)
|
|||
isSmart: (BOOL)smartFlag;
|
||||
@end
|
||||
|
||||
@implementation NSMutableDictionary (EOKVCGNUstepExtensions)
|
||||
|
||||
- (void)GDL2KVCNSMutableDictionaryICategoryID
|
||||
{
|
||||
}
|
||||
@interface GDL2KVCNSMutableDictionary : NSMutableDictionary
|
||||
@end
|
||||
@implementation GDL2KVCNSMutableDictionary
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
GDL2_ActivateCategory("NSMutableDictionary",
|
||||
@selector(GDL2KVCNSMutableDictionaryICategoryID), YES);
|
||||
GDL2_Activate([self class], YES);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,7 +51,7 @@ GDL2CONTROL_EXPORT BOOL
|
|||
GSUseStrictWO451Compatibility(NSString *key);
|
||||
|
||||
GDL2CONTROL_EXPORT void
|
||||
GDL2_ActivateCategory(const char *className, SEL sel, BOOL isInstance);
|
||||
GDL2_Activate(Class cls, BOOL isInstance);
|
||||
|
||||
GDL2CONTROL_EXPORT void
|
||||
GDL2_ActivateAllGDL2Categories(void);
|
||||
|
|
|
@ -64,6 +64,11 @@ RCS_ID("$Id$")
|
|||
|
||||
#include "EOPrivate.h"
|
||||
|
||||
@class GDL2KVCNSObject;
|
||||
@class GDL2KVCNSArray;
|
||||
@class GDL2KVCNSDictionary;
|
||||
@class GDL2KVCNSMutableDictionary;
|
||||
@class GDL2CDNSObject;
|
||||
|
||||
static NSRecursiveLock *local_lock = nil;
|
||||
static BOOL GSStrictWO451Flag = NO;
|
||||
|
@ -98,6 +103,7 @@ GSUseStrictWO451Compatibility (NSString *key)
|
|||
void
|
||||
GDL2_DumpMethodList(Class cls, SEL sel, BOOL isInstance)
|
||||
{
|
||||
/*
|
||||
void *iterator = 0;
|
||||
GSMethodList mList;
|
||||
|
||||
|
@ -113,39 +119,30 @@ GDL2_DumpMethodList(Class cls, SEL sel, BOOL isInstance)
|
|||
mList, meth, imp);
|
||||
}
|
||||
fprintf(stderr,"List finished\n"); fflush(stderr);
|
||||
*/
|
||||
}
|
||||
|
||||
void
|
||||
GDL2_ActivateCategory(const char *className, SEL sel, BOOL isInstance)
|
||||
GDL2_Activate(Class cls, BOOL isInstance)
|
||||
{
|
||||
Class cls;
|
||||
GSMethodList mList;
|
||||
|
||||
cls = GSClassFromName(className);
|
||||
mList = GSMethodListForSelector(cls, sel, 0, isInstance);
|
||||
|
||||
GSRemoveMethodList(cls, mList, isInstance);
|
||||
GSAddMethodList(cls, mList, isInstance);
|
||||
|
||||
GSFlushMethodCacheForClass(cls);
|
||||
if (NO == isInstance)
|
||||
{
|
||||
cls = object_getClass(cls);
|
||||
}
|
||||
GSObjCAddClassOverride([cls superclass], cls);
|
||||
}
|
||||
|
||||
void
|
||||
GDL2_ActivateAllGDL2Categories(void)
|
||||
{
|
||||
/* EOKeyValueCoding */
|
||||
GDL2_ActivateCategory("NSObject",
|
||||
@selector(GDL2KVCNSObjectICategoryID), YES);
|
||||
GDL2_ActivateCategory("NSArray",
|
||||
@selector(GDL2KVCNSArrayICategoryID), YES);
|
||||
GDL2_ActivateCategory("NSDictionary",
|
||||
@selector(GDL2KVCNSDictionaryICategoryID), YES);
|
||||
GDL2_ActivateCategory("NSMutableDictionary",
|
||||
@selector(GDL2KVCNSMutableDictionaryICategoryID), YES);
|
||||
GDL2_Activate([GDL2KVCNSObject class], YES);
|
||||
GDL2_Activate([GDL2KVCNSArray class], YES);
|
||||
GDL2_Activate([GDL2KVCNSDictionary class], YES);
|
||||
GDL2_Activate([GDL2KVCNSMutableDictionary class], YES);
|
||||
|
||||
/* EOClassDescription */
|
||||
GDL2_ActivateCategory("NSObject",
|
||||
@selector(GDL2CDNSObjectICategoryID), YES);
|
||||
GDL2_Activate([GDL2CDNSObject class], YES);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue