view dstep/foundation/NSObject.d @ 20:6255d355d752

Made it compile with dmd 1.056
author Jacob Carlborg <doob@me.com>
date Wed, 03 Feb 2010 18:28:01 +0100
parents 19885b43130e
children f8a3b67adfcb
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Aug 3, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.foundation.NSObject;

import dstep.foundation.NSArchiver;
import dstep.foundation.NSArray;
import dstep.foundation.NSClassDescription;
import dstep.foundation.NSCoder;
import dstep.foundation.NSConnection;
import dstep.foundation.NSData;
import dstep.foundation.NSDictionary;
import dstep.foundation.NSEnumerator;
import dstep.foundation.NSError;
import dstep.foundation.NSFileManager;
import dstep.foundation.NSIndexSet;
import dstep.foundation.NSInvocation;
import dstep.foundation.NSKeyedArchiver;
import dstep.foundation.NSKeyValueCoding;
import dstep.foundation.NSKeyValueObserving;
import dstep.foundation.NSMetadata;
import dstep.foundation.NSMethodSignature;
import dstep.foundation.NSNetServices;
import dstep.foundation.NSObjCRuntime;
import dstep.foundation.NSObjectScripting;
import dstep.foundation.NSPort;
import dstep.foundation.NSPortCoder;
import dstep.foundation.NSPortMessage;
import dstep.foundation.NSRange;
import dstep.foundation.NSRunLoop;
import dstep.foundation.NSScriptClassDescription;
import dstep.foundation.NSScriptKeyValueCoding;
import dstep.foundation.NSScriptObjectSpecifiers;
import dstep.foundation.NSScriptWhoseTests;
import dstep.foundation.NSSet;
import dstep.foundation.NSSpellServer;
import dstep.foundation.NSStream;
import dstep.foundation.NSString;
import dstep.foundation.NSThread;
import dstep.foundation.NSURL;
import dstep.foundation.NSURLAuthenticationChallenge;
import dstep.foundation.NSURLCache;
import dstep.foundation.NSURLConnection;
import dstep.foundation.NSURLDownload;
import dstep.foundation.NSURLRequest;
import dstep.foundation.NSURLResponse;
import dstep.foundation.NSXMLParser;
import dstep.foundation.NSZone;
import dstep.internal.Version;
import dstep.objc.bridge.Bridge;
import dstep.objc.bridge.Wrapper;
import dstep.objc.message;
import dstep.objc.objc;


import bindings = dstep.foundation.NSObject_bindings;

import dstep.objc.runtime;

interface INSCopying
{
	Object copyWithZone (NSZone* zone);
}

interface INSObject
{
	bool isEqual (Object object);
	NSUInteger hash ();
	Class superclass ();
	Class class_ ();
	Object self ();
	NSZone* zone ();
	Object performSelector (SEL aSelector);
	Object performSelector (SEL aSelector, Object object);
	Object performSelector (SEL aSelector, Object object1, Object object2);
	bool isProxy ();
	bool isKindOfClass (Class aClass);
	bool isMemberOfClass (Class aClass);
	bool conformsToProtocol (Protocol aProtocol);
	bool respondsToSelector (SEL aSelector);
	Object retain ();
	void release ();
	Object autorelease ();
	NSUInteger retainCount ();
	NSString description ();
}

interface INSMutableCopying
{
	Object mutableCopyWithZone (NSZone* zone);
}

interface INSCoding
{
	void encodeWithCoder (NSCoder aCoder);
	Object initWithCoder (NSCoder aDecoder);
}

const TNSDeprecatedMethods = `

	static void poseAsClass (Class aClass)
	{
		return invokeObjcSelfClass!(void, "poseAsClass:", Class)(aClass);
	}
	
	//mixin ObjcBindClassMethod!(poseAsClass, "poseAsClass:");
`;

const TNSCoderMethods = `

	static NSInteger version_ ()
	{
		return invokeObjcSelfClass!(NSInteger, "version");
	}
	
	static void setVersion (NSInteger aVersion)
	{
		return invokeObjcSelfClass!(NSInteger, "setVersion");
	}
	
	Class classForCoder ()
	{
		return invokeObjcSelf!(Class, "classForCoder");
	}
	
	Object replacementObjectForCoder (NSCoder aCoder)
	{
		return invokeObjcSelf!(Object, "replacementObjectForCoder:", NSCoder)(aCoder);
	}
	
	Object awakeAfterUsingCoder (NSCoder aDecoder)
	{
		return invokeObjcSelf!(Object, "awakeAfterUsingCoder:", NSCoder)(aDecoder);
	}
	
	//mixin ObjcBindClassMethod!(version_, "version");
	//mixin ObjcBindClassMethod!(setVersion, "setVersion");
	//mixin ObjcBindMethod!(classForCoder, "classForCoder");
	//mixin ObjcBindMethod!(replacementObjectForCoder, "replacementObjectForCoder:");
	//mixin ObjcBindMethod!(awakeAfterUsingCoder, "awakeAfterUsingCoder:");
`;

class NSObject : ObjcWrapper, INSObject
{
	mixin (ObjcWrap);	
	
	this ()
	{
		super(NSObject.alloc.init.objcObject);
	}
		
	NSObject init ()
	{
		return invokeObjcSelf!(NSObject, "init");
	}

	static void load ()
	{
		return invokeObjcSuperClass!(void, "load");
	}

	static void initialize ()
	{
		return invokeObjcSuperClass!(void, "initialize");
	}

	static Object new_ ()
	{
		return invokeObjcSuperClass!(Object, "new");
	}

	static Object allocWithZone (NSZone* zone)
	{
		return invokeObjcSuperClass!(Object, "allocWithZone:", NSZone*)(zone);
	}

	void dealloc ()
	{
		return invokeObjcSelf!(void, "dealloc");
	}

	void finalize ()
	{
		return invokeObjcSelf!(void, "finalize");
	}

	Object copy ()
	{
		return invokeObjcSelf!(Object, "copy");
	}

	Object mutableCopy ()
	{
		return invokeObjcSelf!(Object, "mutableCopy");
	}

	static Object copyWithZone (NSZone* zone)
	{
		return invokeObjcSuperClass!(Object, "copyWithZone:", NSZone*)(zone);
	}

	static Object mutableCopyWithZone (NSZone* zone)
	{
		return invokeObjcSuperClass!(Object, "mutableCopyWithZone:", NSZone*)(zone);
	}

	static Class superclass_static ()
	{
		return invokeObjcSuperClass!(Class, "superclass");
	}

	static Class class_static ()
	{
		return invokeObjcSuperClass!(Class, "class");
	}

	static bool instancesRespondToSelector (SEL aSelector)
	{
		return invokeObjcSuperClass!(bool, "instancesRespondToSelector:", SEL)(aSelector);
	}

	static bool conformsToProtocol (Protocol protocol)
	{
		return invokeObjcSuperClass!(bool, "conformsToProtocol:", Protocol)(protocol);
	}

	IMP methodForSelector (SEL aSelector)
	{
		return invokeObjcSelf!(IMP, "methodForSelector:", SEL)(aSelector);
	}

	static IMP instanceMethodForSelector (SEL aSelector)
	{
		return invokeObjcSuperClass!(IMP, "instanceMethodForSelector:", SEL)(aSelector);
	}

	void doesNotRecognizeSelector (SEL aSelector)
	{
		return invokeObjcSelf!(void, "doesNotRecognizeSelector:", SEL)(aSelector);
	}

	void forwardInvocation (NSInvocation anInvocation)
	{
		return invokeObjcSelf!(void, "forwardInvocation:", NSInvocation)(anInvocation);
	}

	NSMethodSignature methodSignatureForSelector (SEL aSelector)
	{
		return invokeObjcSelf!(NSMethodSignature, "methodSignatureForSelector:", SEL)(aSelector);
	}

	static NSMethodSignature instanceMethodSignatureForSelector (SEL aSelector)
	{
		return invokeObjcSuperClass!(NSMethodSignature, "instanceMethodSignatureForSelector:", SEL)(aSelector);
	}

	static NSString description_static ()
	{
		return invokeObjcSuperClass!(NSString, "description");
	}

	static bool isSubclassOfClass (Class aClass)
	{
		return invokeObjcSuperClass!(bool, "isSubclassOfClass:", Class)(aClass);
	}

	static bool resolveClassMethod (SEL sel)
	{
		return invokeObjcSuperClass!(bool, "resolveClassMethod:", SEL)(sel);
	}

	static bool resolveInstanceMethod (SEL sel)
	{
		return invokeObjcSuperClass!(bool, "resolveInstanceMethod:", SEL)(sel);
	}

	bool isEqual (Object object)
	{
		return invokeObjcSelf!(bool, "isEqual:", Object)(object);
	}

	NSUInteger hash ()
	{
		return invokeObjcSelf!(NSUInteger, "hash");
	}

	Class superclass ()
	{
		return invokeObjcSelf!(Class, "superclass");
	}

	Class class_ ()
	{
		return invokeObjcSelf!(Class, "class");
	}

	Object self ()
	{
		return invokeObjcSelf!(Object, "self");
	}

	NSZone* zone ()
	{
		return invokeObjcSelf!(NSZone*, "zone");
	}

	Object performSelector (SEL aSelector)
	{
		return invokeObjcSelf!(Object, "performSelector:", SEL)(aSelector);
	}

	Object performSelector (SEL aSelector, Object object)
	{
		return invokeObjcSelf!(Object, "performSelector:withObject:", SEL, Object)(aSelector, object);
	}

	Object performSelector (SEL aSelector, Object object1, Object object2)
	{
		return invokeObjcSelf!(Object, "performSelector:withObject:withObject:", SEL, Object, Object)(aSelector, object1, object2);
	}

	bool isProxy ()
	{
		return invokeObjcSelf!(bool, "isProxy");
	}

	bool isKindOfClass (Class aClass)
	{
		return invokeObjcSelf!(bool, "isKindOfClass:", Class)(aClass);
	}

	bool isMemberOfClass (Class aClass)
	{
		return invokeObjcSelf!(bool, "isMemberOfClass:", Class)(aClass);
	}

	bool conformsToProtocol (Protocol aProtocol)
	{
		return invokeObjcSelf!(bool, "conformsToProtocol:", Protocol)(aProtocol);
	}

	bool respondsToSelector (SEL aSelector)
	{
		return invokeObjcSelf!(bool, "respondsToSelector:", SEL)(aSelector);
	}

	Object retain ()
	{
		return invokeObjcSelf!(Object, "retain");
	}

	void release ()
	{
		return invokeObjcSelf!(void, "release");
	}

	Object autorelease ()
	{
		return invokeObjcSelf!(Object, "autorelease");
	}

	NSUInteger retainCount ()
	{
		return invokeObjcSelf!(NSUInteger, "retainCount");
	}

	NSString description ()
	{
		return invokeObjcSelf!(NSString, "description");
	}
	
	// NSArchiverCallback
	Class classForArchiver ()
	{
		return invokeObjcSelf!(Class, "classForArchiver");
	}
	
	Object replacementObjectForArchiver (NSArchiver archiver)
	{
		return invokeObjcSelf!(Object, "replacementObjectForArchiver:", NSArchiver)(archiver);
	}
	
	// NSClassDescriptionPrimitives
	NSClassDescription classDescription ()
	{
		return invokeObjcSelf!(NSClassDescription, "classDescription");
	}
	
	NSArray attributeKeys ()
	{
		return invokeObjcSelf!(NSArray, "attributeKeys");
	}
	
	NSArray toOneRelationshipKeys ()
	{
		return invokeObjcSelf!(NSArray, "toOneRelationshipKeys");
	}
	
	NSArray toManyRelationshipKeys ()
	{
		return invokeObjcSelf!(NSArray, "toManyRelationshipKeys");
	}
	
	NSString inverseForRelationshipKey (NSString relationshipKey)
	{
		return invokeObjcSelf!(NSString, "inverseForRelationshipKey:", NSString)(relationshipKey);
	}
	
	// NSCoderMethods
	static NSInteger version_ ()
	{
		return invokeObjcSelfClass!(NSInteger, "version");
	}
	
	static void setVersion (NSInteger aVersion)
	{
		return invokeObjcSelfClass!(NSInteger, "setVersion");
	}
	
	Class classForCoder ()
	{
		return invokeObjcSelf!(Class, "classForCoder");
	}
	
	Object replacementObjectForCoder (NSCoder aCoder)
	{
		return invokeObjcSelf!(Object, "replacementObjectForCoder:", NSCoder)(aCoder);
	}
	
	Object awakeAfterUsingCoder (NSCoder aDecoder)
	{
		return invokeObjcSelf!(Object, "awakeAfterUsingCoder:", NSCoder)(aDecoder);
	}
	
	// NSComparisonMethods
	bool isEqualTo (Object object)
	{
		return invokeObjcSelf!(bool, "isEqualTo:", Object)(object);
	}
	
	bool isLessThanOrEqualTo (Object object)
	{
		return invokeObjcSelf!(bool, "isLessThanOrEqualTo:", Object)(object);
	}
	
	bool isLessThan (Object object)
	{
		return invokeObjcSelf!(bool, "isLessThan:", Object)(object);
	}
	
	bool isGreaterThanOrEqualTo (Object object)
	{
		return invokeObjcSelf!(bool, "isGreaterThanOrEqualTo:", Object)(object);
	}
	
	bool isGreaterThan (Object object)
	{
		return invokeObjcSelf!(bool, "isGreaterThan:", Object)(object);
	}
	
	bool isNotEqualTo (Object object)
	{
		return invokeObjcSelf!(bool, "isNotEqualTo:", Object)(object);
	}
	
	bool doesContain (Object object)
	{
		return invokeObjcSelf!(bool, "doesContain:", Object)(object);
	}
	
	bool isLike (NSString object)
	{
		return invokeObjcSelf!(bool, "isLike:", NSString)(object);
	}
	
	bool isCaseInsensitiveLike (NSString object)
	{
		return invokeObjcSelf!(bool, "isCaseInsensitiveLike:", NSString)(object);
	}
	
	// NSConnectionDelegateMethods
	bool makeNewConnection (NSConnection conn, NSConnection ancestor)
	{
		return invokeObjcSelf!(bool, "makeNewConnection:sender:", NSConnection, NSConnection)(conn, ancestor);
	}
	
	bool connection (NSConnection ancestor, NSConnection conn)
	{
		return invokeObjcSelf!(bool, "connection:shouldMakeNewConnection:", NSConnection, NSConnection)(ancestor, conn);
	}
	
	NSData authenticationDataForComponents (NSArray components)
	{
		return invokeObjcSelf!(NSData, "authenticationDataForComponents:", NSArray)(components);
	}
	
	bool authenticateComponents (NSArray components, NSData signature)
	{
		return invokeObjcSelf!(bool, "authenticateComponents:withData:", NSArray, NSData)(components, signature);
	}
	
	Object createConversationForConnection (NSConnection conn)
	{
		return invokeObjcSelf!(Object, "createConversationForConnection:", NSConnection)(conn);
	}
	
	// NSCopyLinkMoveHandler
	bool fileManager (NSFileManager fm, NSDictionary errorInfo)
	{
		return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:", NSFileManager, NSDictionary)(fm, errorInfo);
	}
	
	void fileManager (NSFileManager fm, NSString path)
	{
		return invokeObjcSelf!(void, "fileManager:willProcessPath:", NSFileManager, NSString)(fm, path);
	}
	
	// NSDelayedPerforming
	void performSelector (SEL aSelector, Object anArgument, double delay, NSArray modes)
	{
		return invokeObjcSelf!(void, "performSelector:withObject:afterDelay:inModes:", SEL, Object, double, NSArray)(aSelector, anArgument, delay, modes);
	}
	
	void performSelector (SEL aSelector, Object anArgument, double delay)
	{
		return invokeObjcSelf!(void, "performSelector:withObject:afterDelay:", SEL, Object, double)(aSelector, anArgument, delay);
	}
	
	static void cancelPreviousPerformRequestsWithTarget (Object aTarget, SEL aSelector, Object anArgument)
	{
		return invokeObjcSelfClass!(void, "cancelPreviousPerformRequestsWithTarget:selector:object:", Object, SEL, Object)(aTarget, aSelector, anArgument);
	}
	
	static void cancelPreviousPerformRequestsWithTarget (Object aTarget)
	{
		return invokeObjcSelfClass!(void, "cancelPreviousPerformRequestsWithTarget:", Object)(aTarget);
	}
	
	// NSDeprecatedKeyValueCoding
	static bool useStoredAccessor ()
	{
		return invokeObjcSelfClass!(bool, "useStoredAccessor");
	}
	
	Object storedValueForKey (NSString key)
	{
		return invokeObjcSelf!(Object, "storedValueForKey:", NSString)(key);
	}
	
	void takeStoredValue (Object value, NSString key)
	{
		return invokeObjcSelf!(void, "takeStoredValue:forKey:", Object, NSString)(value, key);
	}
	
	void takeValue (Object value, NSString key)
	{
		return invokeObjcSelf!(void, "takeValue:forKey:", Object, NSString)(value, key);
	}
	
	void takeValue_forKeyPath (Object value, NSString keyPath)
	{
		return invokeObjcSelf!(void, "takeValue:forKeyPath:", Object, NSString)(value, keyPath);
	}
	
	Object handleQueryWithUnboundKey (NSString key)
	{
		return invokeObjcSelf!(Object, "handleQueryWithUnboundKey:", NSString)(key);
	}
	
	void handleTakeValue (Object value, NSString key)
	{
		return invokeObjcSelf!(void, "handleTakeValue:forUnboundKey:", Object, NSString)(value, key);
	}
	
	void unableToSetNilForKey (NSString key)
	{
		return invokeObjcSelf!(void, "unableToSetNilForKey:", NSString)(key);
	}
	
	NSDictionary valuesForKeys (NSArray keys)
	{
		return invokeObjcSelf!(NSDictionary, "valuesForKeys:", NSArray)(keys);
	}
	
	void takeValuesFromDictionary (NSDictionary properties)
	{
		return invokeObjcSelf!(void, "takeValuesFromDictionary:", NSDictionary)(properties);
	}
	
	// NSDeprecatedKeyValueObservingCustomization
	static void setKeys (NSArray keys, NSString dependentKey)
	{
		return invokeObjcSelfClass!(void, "setKeys:triggerChangeNotificationsForDependentKey:", NSArray, NSString)(keys, dependentKey);
	}
	
	// NSDeprecatedMethods
	static void poseAsClass (Class aClass)
	{
		return invokeObjcSelfClass!(void, "poseAsClass:", Class)(aClass);
	}
	
	// NSDistantObjectRequestMethods
	bool connection (NSConnection connection, NSDistantObjectRequest doreq)
	{
		return invokeObjcSelf!(bool, "connection:handleRequest:", NSConnection, NSDistantObjectRequest)(connection, doreq);
	}
	
	// NSDistributedObjects
	Class classForPortCoder ()
	{
		return invokeObjcSelf!(Class, "classForPortCoder");
	}
	
	Object replacementObjectForPortCoder (NSPortCoder coder)
	{
		return invokeObjcSelf!(Object, "replacementObjectForPortCoder:", NSPortCoder)(coder);
	}
	
	// NSErrorRecoveryAttempting
	/*void attemptRecoveryFromError (NSError error, NSUInteger recoveryOptionIndex, Object delegate_, SEL didRecoverSelector, void* contextInfo)
	{
		return invokeObjcSelf!(void, "attemptRecoveryFromError:optionIndexdelegate:didRecoverSelector:contextInfo:", NSError, NSUInteger, Object, SEL, void*)(error, recoveryOptionIndex, delegate_, didRecoverSelector, contextInfo);
	}
	
	bool attemptRecoveryFromError (NSError error, NSUInteger recoveryOptionIndex)
	{
		return invokeObjcSelf!(bool, "attemptRecoveryFromError:optionIndex:", NSError, NSUInteger)(error, recoveryOptionIndex);
	}
	
	// NSFileManagerFileOperationAdditions
	bool fileManager_shouldCopyItemAtPath_toPath_dstPath (NSFileManager fileManager, NSString srcPath, NSString dstPath)
	{
		return invokeObjcSelf!(bool, "fileManager:shouldCopyItemAtPath:toPath:dstPath:", NSFileManager, NSString, NSString);
	}*/
	
	bool fileManager (NSFileManager fileManager, NSError error, NSString srcPath, NSString dstPath)
	{
		return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:", NSFileManager, NSError, NSString, NSString)(fileManager, error, srcPath, dstPath);
	}
	
	bool fileManager (NSFileManager fileManager, NSString srcPath, NSString dstPath)
	{
		return invokeObjcSelf!(bool, "fileManager:shouldMoveItemAtPath:toPath:", NSFileManager, NSString, NSString)(fileManager, srcPath, dstPath);
	}
	
	bool fileManager_shouldProceedAfterError_movingItemAtPath_toPath (NSFileManager fileManager, NSError error, NSString srcPath, NSString dstPath)
	{
		 return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:movingItemAtPath:toPath:", NSFileManager, NSError, NSString, NSString)(fileManager, error, srcPath, dstPath);
	}
	
	bool fileManager (NSFileManager fileManager, NSString srcPath, NSString dstPath)
	{
		return invokeObjcSelf!(bool, "fileManager:shouldLinkItemAtPath:toPath:", NSFileManager, NSString, NSString)(fileManager, srcPath, dstPath);
	}
	
	bool fileManager_shouldProceedAfterError_linkingItemAtPath_toPath (NSFileManager fileManager, NSError error, NSString srcPath, NSString dstPath)
	{
		return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:", NSFileManager, NSError, NSString, NSString)(fileManager, error, srcPath, dstPath);
	}
	
	bool fileManager_shouldRemoveItemAtPath (NSFileManager fileManager, NSString path)
	{
		return invokeObjcSelf!(bool, "fileManager:shouldRemoveItemAtPath:", NSFileManager, NSString)(fileManager, path);
	}
	
	bool fileManager (NSFileManager fileManager, NSError error, NSString path)
	{
		return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:removingItemAtPath:", NSFileManager, NSError, NSString)(fileManager, error, path);
	}
	
	// NSKeyedArchiverDelegate
	Object archiver (NSKeyedArchiver archiver, Object object)
	{
		return invokeObjcSelf!(Object, "archiver:willEncodeObject:", NSKeyedArchiver, Object)(archiver, object);
	}
	
	void archiver_didEncodeObject (NSKeyedArchiver archiver, Object object)
	{
		return invokeObjcSelf!(void, "archiver:didEncodeObject:", NSKeyedArchiver, Object)(archiver, object);
	}
	
	void archiver (NSKeyedArchiver archiver, Object object, Object newObject)
	{
		return invokeObjcSelf!(void, "archiver:willReplaceObject:withObject:", NSKeyedArchiver, Object, Object)(archiver, object, newObject);
	}
	
	void archiverWillFinish (NSKeyedArchiver archiver)
	{
		return invokeObjcSelf!(void, "archiverWillFinish:", NSKeyedArchiver)(archiver);
	}
	
	void archiverDidFinish (NSKeyedArchiver archiver)
	{
		return invokeObjcSelf!(void, "archiverDidFinish:", NSKeyedArchiver)(archiver);
	}
	
	// NSKeyedArchiverObjectSubstitution
	Class classForKeyedArchiver ()
	{
		return invokeObjcSelf!(Class, "classForKeyedArchiver");
	}
	
	Object replacementObjectForKeyedArchiver (NSKeyedArchiver archiver)
	{
		return invokeObjcSelf!(Object, "replacementObjectForKeyedArchiver:", NSKeyedArchiver)(archiver);
	}
	
	static NSArray classFallbacksForKeyedArchiver ()
	{
		return invokeObjcSelfClass!(NSArray, "classFallbacksForKeyedArchiver");
	}
	
	// NSKeyedUnarchiverDelegate
	Class unarchiver (NSKeyedUnarchiver unarchiver, NSString name, NSArray classNames)
	{
		return invokeObjcSelf!(Class, "unarchiver:cannotDecodeObjectOfClassName:originalClasses:", NSKeyedUnarchiver, NSString, NSArray)(unarchiver, name, classNames);
	}
	
	Object unarchiver (NSKeyedUnarchiver unarchiver, Object object)
	{
		return invokeObjcSelf!(Object, "unarchiver:didDecodeObject:", NSKeyedUnarchiver, Object)(unarchiver, object);
	}
	
	void unarchiver (NSKeyedUnarchiver unarchiver, Object object, Object newObject)
	{
		return invokeObjcSelf!(void, "unarchiver:willReplaceObject:withObject:", NSKeyedUnarchiver, Object, Object)(unarchiver, object, newObject);
	}
	
	void unarchiverWillFinish (NSKeyedUnarchiver unarchiver)
	{
		return invokeObjcSelf!(void, "unarchiverWillFinish:", NSKeyedUnarchiver)(unarchiver);
	}
	
	void unarchiverDidFinish (NSKeyedUnarchiver unarchiver)
	{
		return invokeObjcSelf!(void, "unarchiverDidFinish:", NSKeyedUnarchiver)(unarchiver);
	}
	
	// NSKeyedUnarchiverObjectSubstitution
	static Class classForKeyedUnarchiver ()
	{
		return invokeObjcSelfClass!(Class, "classForKeyedUnarchiver");
	}
	
	// NSKeyValueCoding
	static bool accessInstanceVariablesDirectly ()
	{
		return invokeObjcSelfClass!(bool, "accessInstanceVariablesDirectly");
	}
	
	Object valueForKey (NSString key)
	{
		return invokeObjcSelf!(Object, "valueForKey:", NSString)(key);
	}
	
	void setValue (Object value, NSString key)
	{
		return invokeObjcSelf!(void, "setValue:forKey:", Object, NSString)(value, key);
	}
	
	bool validateValue (id* ioValue, NSString inKey, ref NSError outError)
	{
		id error;
		
		if (outError)
			error = new objc_object;
		
		bool result = invokeObjcSelf!(bool, "validateValue:forKey:error:", id*, NSString, id*)(ioValue, inKey, &error);
		
		if (error)
			outError = new NSError(error);
			
		return result;
	}
	
	NSMutableArray mutableArrayValueForKey (NSString key)
	{
		return invokeObjcSelf!(NSMutableArray, "mutableArrayValueForKey:", NSString)(key);
	}
	
	NSMutableSet mutableSetValueForKey (NSString key)
	{
		return invokeObjcSelf!(NSMutableSet, "mutableSetValueForKey:", NSString)(key);
	}
	
	Object valueForKeyPath (NSString keyPath)
	{
		return invokeObjcSelf!(Object, "valueForKeyPath:", NSString)(keyPath);
	}
	
	void setValue_forKeyPath (Object value, NSString keyPath)
	{
		return invokeObjcSelf!(void, "setValue:forKeyPath:", Object, NSString)(value, keyPath);
	}
	
	bool validateValue_forKeyPath_error (id* ioValue, NSString inKeyPath, ref NSError outError)
	{
		id error;
					
		if (outError)
			error = new objc_object;
	
		bool result = invokeObjcSelf!(bool, "validateValue:forKeyPath:error:", id*, NSString, id*)(ioValue, inKeyPath, &error);
	
		if (error)
			outError = new NSError(error);
	
		return result; 
	}
	
	NSMutableArray mutableArrayValueForKeyPath (NSString keyPath)
	{
		return invokeObjcSelf!(NSMutableArray, "mutableArrayValueForKeyPath:", NSString)(keyPath);
	}
	
	NSMutableSet mutableSetValueForKeyPath (NSString keyPath)
	{
		return invokeObjcSelf!(NSMutableSet, "mutableSetValueForKeyPath:", NSString)(keyPath);
	}
	
	Object valueForUndefinedKey (NSString key)
	{
		return invokeObjcSelf!(Object, "valueForUndefinedKey:", NSString)(key);
	}
	
	void setValue_forUndefinedKey (Object value, NSString key)
	{
		return invokeObjcSelf!(void, "setValue:forUndefinedKey:", Object, NSString)(value, key);
	}
	
	void setNilValueForKey (NSString key)
	{
		return invokeObjcSelf!(void, "setNilValueForKey:", NSString)(key);
	}
	
	NSDictionary dictionaryWithValuesForKeys (NSArray keys)
	{
		return invokeObjcSelf!(NSDictionary, "dictionaryWithValuesForKeys:", NSArray)(keys);
	}
	
	void setValuesForKeysWithDictionary (NSDictionary keyedValues)
	{
		return invokeObjcSelf!(void, "setValuesForKeysWithDictionary:", NSDictionary)(keyedValues);
	}
	
	// NSKeyValueObserverNotification
	void willChangeValueForKey (NSString key)
	{
		return invokeObjcSelf!(void, "willChangeValueForKey:", NSString)(key);
	}
	
	void didChangeValueForKey (NSString key)
	{
		return invokeObjcSelf!(void, "didChangeValueForKey:", NSString)(key);
	}
	
	void willChange (NSKeyValueChange changeKind, NSIndexSet indexes, NSString key)
	{
		return invokeObjcSelf!(void, "willChange:valuesAtIndexes:forKey:", NSKeyValueChange, NSIndexSet, NSString)(changeKind, indexes, key);
	}
	
	void didChange (NSKeyValueChange changeKind, NSIndexSet indexes, NSString key)
	{
		return invokeObjcSelf!(void, "didChange:valuesAtIndexes:forKey:", NSKeyValueChange, NSIndexSet, NSString)(changeKind, indexes, key);
	}
	
	void willChangeValueForKey (NSString key, NSKeyValueSetMutationKind mutationKind, NSSet objects)
	{
		return invokeObjcSelf!(void, "willChangeValueForKey:withSetMutation:usingObjects:", NSString, NSKeyValueSetMutationKind, NSSet)(key, mutationKind, objects);
	}
	
	void didChangeValueForKey (NSString key, NSKeyValueSetMutationKind mutationKind, NSSet objects)
	{
		return invokeObjcSelf!(void, "didChangeValueForKey:withSetMutation:usingObjects:", NSString, NSKeyValueSetMutationKind, NSSet)(key, mutationKind, objects);
	}
	
	// NSKeyValueObserving
	void observeValueForKeyPath (NSString keyPath, Object object, NSDictionary change, void* context)
	{
		return invokeObjcSelf!(void, "observeValueForKeyPath:ofObject:change:context:", NSString, Object, NSDictionary, void*)(keyPath, object, change, context);
	}
	
	// NSKeyValueObservingCustomization
	static NSSet keyPathsForValuesAffectingValueForKey (NSString key)
	{
		return invokeObjcSelfClass!(NSSet, "keyPathsForValuesAffectingValueForKey:", NSString)(key);
	}
	
	static bool automaticallyNotifiesObserversForKey (NSString key)
	{
		return invokeObjcSelfClass!(bool, "automaticallyNotifiesObserversForKey:", NSString)(key);
	}
	
	void setObservationInfo (void* observationInfo)
	{
		return invokeObjcSelf!(void, "setObservationInfo:", void*)(observationInfo);
	}
	
	void* observationInfo ()
	{
		return invokeObjcSelf!(void*, "observationInfo");
	}
	
	// NSMachPortDelegateMethods
	void handleMachMessage (void* msg)
	{
		return invokeObjcSelf!(void, "handleMachMessage:", void*)(msg);
	}
	
	// NSMetadataQueryDelegate
	Object metadataQuery (NSMetadataQuery query, NSMetadataItem result)
	{
		return invokeObjcSelf!(Object, "metadataQuery:replacementObjectForResultObject:", NSMetadataQuery, NSMetadataItem)(query, result);
	}
	
	Object metadataQuery (NSMetadataQuery query, NSString attrName, Object attrValue)
	{
		return invokeObjcSelf!(Object, "metadataQuery:replacementValueForAttribute:value:", NSMetadataQuery, NSString, Object)(query, attrName, attrValue);
	}
	
	// NSNetServiceBrowserDelegateMethods
	void netServiceBrowserWillSearch (NSNetServiceBrowser aNetServiceBrowser)
	{
		return invokeObjcSelf!(void, "netServiceBrowserWillSearch:", NSNetServiceBrowser)(aNetServiceBrowser);
	}
	
	void netServiceBrowserDidStopSearch (NSNetServiceBrowser aNetServiceBrowser)
	{
		return invokeObjcSelf!(void, "netServiceBrowserDidStopSearch:", NSNetServiceBrowser)(aNetServiceBrowser);
	}
	
	void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSDictionary errorDict)
	{
		return invokeObjcSelf!(void, "netServiceBrowser:didNotSearch:", NSNetServiceBrowser, NSDictionary)(aNetServiceBrowser, errorDict);
	}
	
	void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSString domainString, bool moreComing)
	{
		return invokeObjcSelf!(void, "netServiceBrowser:didFindDomain:moreComing:", NSNetServiceBrowser, NSString, bool)(aNetServiceBrowser, domainString, moreComing);
	}
	
	void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSNetService aNetService, bool moreComing)
	{
		return invokeObjcSelf!(void, "netServiceBrowser:didFindService:moreComing:", NSNetServiceBrowser, NSNetService, bool)(aNetServiceBrowser, aNetService, moreComing);
	}
	
	void netServiceBrowser_didRemoveDomain_moreComing (NSNetServiceBrowser aNetServiceBrowser, NSString domainString, bool moreComing)
	{
		return invokeObjcSelf!(void, "netServiceBrowser:didRemoveDomain:moreComing:", NSNetServiceBrowser, NSString, bool)(aNetServiceBrowser, domainString, moreComing);
	}
	
	void netServiceBrowser_didRemoveService_moreComing (NSNetServiceBrowser aNetServiceBrowser, NSNetService aNetService, bool moreComing)
	{
		return invokeObjcSelf!(void, "netServiceBrowser:didRemoveService:moreComing:", NSNetServiceBrowser, NSNetService, bool)(aNetServiceBrowser, aNetService, moreComing);
	}
	
	// NSNetServiceDelegateMethods
	void netServiceWillPublish (NSNetService sender)
	{
		return invokeObjcSelf!(void, "netServiceWillPublish:", NSNetService)(sender);
	}
	
	void netServiceDidPublish (NSNetService sender)
	{
		return invokeObjcSelf!(void, "netServiceDidPublish:", NSNetService)(sender);
	}
	
	void netService (NSNetService sender, NSDictionary errorDict)
	{
		return invokeObjcSelf!(void, "netService:didNotPublish:", NSNetService, NSDictionary)(sender, errorDict);
	}
	
	void netServiceWillResolve (NSNetService sender)
	{
		return invokeObjcSelf!(void, "netServiceWillResolve:", NSNetService)(sender);
	}
	
	void netServiceDidResolveAddress (NSNetService sender)
	{
		return invokeObjcSelf!(void, "netServiceDidResolveAddress:", NSNetService)(sender);
	}
	
	void netService_didNotPublish (NSNetService sender, NSDictionary errorDict)
	{
		return invokeObjcSelf!(void, "netService:didNotPublish:", NSNetService, NSDictionary)(sender, errorDict);
	}
	
	void netServiceDidStop (NSNetService sender)
	{
		return invokeObjcSelf!(void, "netServiceDidStop:", NSNetService)(sender);
	}
	
	void netService (NSNetService sender, NSData data)
	{
		return invokeObjcSelf!(void, "netService:didUpdateTXTRecordData:", NSNetService, NSData)(sender, data);
	}
	
	// NSPortDelegateMethods
	void handlePortMessage (NSPortMessage message)
	{
		return invokeObjcSelf!(void, "handlePortMessage:", NSPortMessage)(message);
	}
	
	// NSScriptingComparisonMethods
	uint classCode ()
	{
		return invokeObjcSelf!(uint, "classCode");
	}
	
	NSString className ()
	{
		return invokeObjcSelf!(NSString, "className");
	}
	
	// NSScriptKeyValueCoding
	Object scriptingValueForSpecifier (NSScriptObjectSpecifier objectSpecifier)
	{
		return invokeObjcSelf!(Object, "scriptingValueForSpecifier:", NSScriptObjectSpecifier)(objectSpecifier);
	}
	
	NSDictionary scriptingProperties ()
	{
		return invokeObjcSelf!(NSDictionary, "scriptingProperties");
	}
	
	void setScriptingProperties (NSDictionary properties)
	{
		return invokeObjcSelf!(void, "setScriptingProperties:", NSDictionary)(properties);
	}
	
	Object copyScriptingValue (Object value, NSString key, NSDictionary properties)
	{
		return invokeObjcSelf!(Object, "copyScriptingValue:forKey:withProperties:", Object, NSString, NSDictionary)(value, key, properties);
	}
	
	Object newScriptingObjectOfClass (Class objectClass, NSString key, Object contentsValue, NSDictionary properties)
	{
		return invokeObjcSelf!(Object, "newScriptingObjectOfClass:forValueForKey:withContentsValue:properties:", Class, NSString, Object, NSDictionary)(objectClass, key, contentsValue, properties);
	}
	
	Object scriptingValueForSpecifier (NSScriptObjectSpecifier objectSpecifier)
	{
		return invokeObjcSelf!(Object, "scriptingValueForSpecifier:", NSScriptObjectSpecifier)(objectSpecifier);
	}
	
	bool scriptingIsEqualTo (Object object)
	{
		return invokeObjcSelf!(bool, "scriptingIsEqualTo:", Object)(object);
	}
	
	bool scriptingIsLessThanOrEqualTo (Object object)
	{
		return invokeObjcSelf!(bool, "scriptingIsLessThanOrEqualTo:", Object)(object);
	}
	
	bool scriptingIsLessThan (Object object)
	{
		return invokeObjcSelf!(bool, "scriptingIsLessThan:", Object)(object);
	}
	
	bool scriptingIsGreaterThanOrEqualTo (Object object)
	{
		return invokeObjcSelf!(bool, "scriptingIsGreaterThanOrEqualTo:", Object)(object);
	}
	
	bool scriptingIsGreaterThan (Object object)
	{
		return invokeObjcSelf!(bool, "scriptingIsGreaterThan:", Object)(object);
	}
	
	bool scriptingBeginsWith (Object object)
	{
		return invokeObjcSelf!(bool, "scriptingBeginsWith:", Object)(object);
	}
	
	bool scriptingEndsWith (Object object)
	{
		return invokeObjcSelf!(bool, "scriptingEndsWith:", Object)(object);
	}
	
	bool scriptingContains (Object object)
	{
		return invokeObjcSelf!(bool, "scriptingContains:", Object)(object);
	}
	
	Object valueAtIndex (NSUInteger index, NSString key)
	{
		return invokeObjcSelf!(Object, "valueAtIndex:inPropertyWithKey:", NSUInteger, NSString)(index, key);
	}
	
	Object valueWithName (NSString name, NSString key)
	{
		return invokeObjcSelf!(Object, "valueWithName:inPropertyWithKey:", NSString, NSString)(name, key);
	}
	
	Object valueWithUniqueID (Object uniqueID, NSString key)
	{
		return invokeObjcSelf!(Object, "valueWithUniqueID:inPropertyWithKey:", Object, NSString)(uniqueID, key);
	}
	
	void insertValue (Object value, NSUInteger index, NSString key)
	{
		return invokeObjcSelf!(void, "insertValue:atIndex:inPropertyWithKey:", Object, NSUInteger, NSString)(value, index, key);
	}
	
	void removeValueAtIndex (NSUInteger index, NSString key)
	{
		return invokeObjcSelf!(void, "removeValueAtIndex:fromPropertyWithKey:", NSUInteger, NSString)(index, key);
	}
	
	void replaceValueAtIndex (NSUInteger index, NSString key, Object value)
	{
		return invokeObjcSelf!(void, "replaceValueAtIndex:inPropertyWithKey:withValue:", NSUInteger, NSString, Object)(index, key, value);
	}
	
	void insertValue (Object value, NSString key)
	{
		return invokeObjcSelf!(void, "insertValue:inPropertyWithKey:", Object, NSString)(value, key);
	}
	
	Object coerceValue (Object value, NSString key)
	{
		return invokeObjcSelf!(Object, "coerceValue:forKey:", Object, NSString)(value, key);
	}
	
	NSScriptObjectSpecifier objectSpecifier ()
	{
		return invokeObjcSelf!(NSScriptObjectSpecifier, "objectSpecifier");
	}
	
	NSArray indicesOfObjectsByEvaluatingObjectSpecifier (NSScriptObjectSpecifier specifier)
	{
		return invokeObjcSelf!(NSArray, "indicesOfObjectsByEvaluatingObjectSpecifier:", NSScriptObjectSpecifier)(specifier);
	}
	
	NSRange spellServer (NSSpellServer sender, NSString stringToCheck, NSString language, NSInteger* wordCount, bool countOnly)
	{
		return invokeObjcSelf!(NSRange, "spellServer:findMisspelledWordInString:language:wordCount:countOnly:", NSSpellServer, NSString, NSString, NSInteger*, bool)(sender, stringToCheck, language, wordCount, countOnly);
	}
	
	NSArray spellServer (NSSpellServer sender, NSString word, NSString language)
	{
		return invokeObjcSelf!(NSArray, "spellServer:suggestGuessesForWord:inLanguage:", NSSpellServer, NSString, NSString)(sender, word, language);
	}
	
	void spellServer_didLearnWord_inLanguage (NSSpellServer sender, NSString word, NSString language)
	{
		return invokeObjcSelf!(void, "spellServer:didLearnWord:inLanguage:", NSSpellServer, NSString, NSString)(sender, word, language);
	}
	
	void spellServer (NSSpellServer sender, NSString word, NSString language)
	{
		return invokeObjcSelf!(void, "spellServer:didForgetWord:inLanguage:", NSSpellServer, NSString, NSString)(sender, word, language);
	}
	
	NSArray spellServer (NSSpellServer sender, NSRange range, NSString string, NSString language)
	{
		return invokeObjcSelf!(NSArray, "spellServer:suggestCompletionsForPartialWordRange:inString:language:", NSSpellServer, NSRange, NSString, NSString)(sender, range, string, language);
	}
	
	NSRange spellServer (NSSpellServer sender, NSString stringToCheck, NSString language, out NSArray details)
	{
		id det = new objc_object;
		
		NSRange result = invokeObjcSelf!(NSRange, "spellServer:checkGrammarInString:language:details:", NSSpellServer, NSString, NSString, id*)(sender, stringToCheck, language, &det);
		
		if (det)
			details = new NSArray(det);
			
		return result;
	}
	
	void stream (NSStream aStream, NSStreamEvent eventCode)
	{
		return invokeObjcSelf!(void, "stream:handleEvent:", NSStream, NSStreamEvent)(aStream, eventCode);
	}
	
	void performSelectorOnMainThread (SEL aSelector, Object arg, bool wait, NSArray array)
	{
		return invokeObjcSelf!(void, "performSelectorOnMainThread:withObject:waitUntilDone:modes:", SEL, Object, bool, NSArray)(aSelector, arg, wait, array);
	}
	
	void performSelectorOnMainThread (SEL aSelector, Object arg, bool wait)
	{
		return invokeObjcSelf!(void, "performSelectorOnMainThread:withObject:waitUntilDone:", SEL, Object, bool)(aSelector, arg, wait);
	}
	
	void performSelector (SEL aSelector, NSThread thr, Object arg, bool wait, NSArray array)
	{
		return invokeObjcSelf!(void, "performSelector:onThread:withObject:waitUntilDone:modes:", SEL, NSThread, Object, bool, NSArray)(aSelector, thr, arg, wait, array);
	}
	
	void performSelector (SEL aSelector, NSThread thr, Object arg, bool wait)
	{
		return invokeObjcSelf!(void, "performSelector:onThread:withObject:waitUntilDone:", SEL, NSThread, Object, bool)(aSelector, thr, arg, wait);
	}
	
	void performSelectorInBackground (SEL aSelector, Object arg)
	{
		return invokeObjcSelf!(void, "performSelectorInBackground:withObject:", SEL, Object)(aSelector, arg);
	}
	
	void URL (NSURL sender, NSData newBytes)
	{
		return invokeObjcSelf!(void, "URL:resourceDataDidBecomeAvailable:", NSURL, NSData)(sender, newBytes);
	}
			
	void URLResourceDidFinishLoading (NSURL sender)
	{
		return invokeObjcSelf!(void, "URLResourceDidFinishLoading:", NSURL)(sender);
	}
	
	void URLResourceDidCancelLoading (NSURL sender)
	{
		return invokeObjcSelf!(void, "URLResourceDidCancelLoading:", NSURL)(sender);
	}
	
	void URL (NSURL sender, NSString reason)
	{
		return invokeObjcSelf!(void, "URL:resourceDidFailLoadingWithReason:", NSURL, NSString)(sender, reason);
	}
	
	NSURLRequest connection (NSURLConnection connection, NSURLRequest request, NSURLResponse response)
	{
		return invokeObjcSelf!(NSURLRequest, "connection:willSendRequest:redirectResponse:", NSURLConnection, NSURLRequest, NSURLResponse)(connection, request, response);
	}
	
	void connection (NSURLConnection connection, NSURLAuthenticationChallenge challenge)
	{
		return invokeObjcSelf!(void, "connection:didReceiveAuthenticationChallenge:", NSURLConnection, NSURLAuthenticationChallenge)(connection, challenge);
	}
	
	void connection_didCancelAuthenticationChallenge (NSURLConnection connection, NSURLAuthenticationChallenge challenge)
	{
		return invokeObjcSelf!(void, "connection:didCancelAuthenticationChallenge:", NSURLConnection, NSURLAuthenticationChallenge)(connection, challenge);
	}
	
	void connection (NSURLConnection connection, NSURLResponse response)
	{
		return invokeObjcSelf!(void, "connection:didReceiveResponse:", NSURLConnection, NSURLResponse)(connection, response);
	}
	
	void connection (NSURLConnection connection, NSData data)
	{
		return invokeObjcSelf!(void, "connection:didReceiveData:", NSURLConnection, NSData)(connection, data);
	}
	
	void connectionDidFinishLoading (NSURLConnection connection)
	{
		return invokeObjcSelf!(void, "connectionDidFinishLoading:", NSURLConnection)(connection);
	}
	
	void connection (NSURLConnection connection, NSError error)
	{
		return invokeObjcSelf!(void, "connection:didFailWithError:", NSURLConnection, NSError)(connection, error);
	}
	
	NSCachedURLResponse connection (NSURLConnection connection, NSCachedURLResponse cachedResponse)
	{
		return invokeObjcSelf!(NSCachedURLResponse, "connection:willCacheResponse:", NSURLConnection, NSCachedURLResponse)(connection, cachedResponse);
	}
	
	void downloadDidBegin (NSURLDownload download)
	{
		return invokeObjcSelf!(void, "downloadDidBegin:", NSURLDownload)(download);
	}
	
	NSURLRequest download (NSURLDownload download, NSURLRequest request, NSURLResponse redirectResponse)
	{
		return invokeObjcSelf!(NSURLRequest, "download:willSendRequest:redirectResponse:", NSURLDownload, NSURLRequest, NSURLResponse)(download, request, redirectResponse);
	}
	
	void download (NSURLDownload download, NSURLAuthenticationChallenge challenge)
	{
		return invokeObjcSelf!(void, "download:didReceiveAuthenticationChallenge:", NSURLDownload, NSURLAuthenticationChallenge)(download, challenge);
	}
	
	void download_didCancelAuthenticationChallenge (NSURLDownload download, NSURLAuthenticationChallenge challenge)
	{
		return invokeObjcSelf!(void, "download:didCancelAuthenticationChallenge:", NSURLDownload, NSURLAuthenticationChallenge)(download, challenge);
	}
	
	void download (NSURLDownload download, NSURLResponse response)
	{
		return invokeObjcSelf!(void, "download:didReceiveResponse:", NSURLDownload, NSURLResponse)(download, response);
	}
	
	void download (NSURLDownload download, NSURLResponse response, long startingByte)
	{
		return invokeObjcSelf!(void, "download:willResumeWithResponse:fromByte:", NSURLDownload, NSURLResponse, long)(download, response, startingByte);
	}
	
	void download (NSURLDownload download, NSUInteger length)
	{
		return invokeObjcSelf!(void, "download:didReceiveDataOfLength:", NSURLDownload, NSUInteger)(download, length);
	}
	
	bool download (NSURLDownload download, NSString encodingType)
	{
		return invokeObjcSelf!(bool, "download:shouldDecodeSourceDataOfMIMEType:", NSURLDownload, NSString)(download, encodingType);
	}
	
	void download_decideDestinationWithSuggestedFilename (NSURLDownload download, NSString filename)
	{
		return invokeObjcSelf!(void, "download:decideDestinationWithSuggestedFilename:", NSURLDownload, NSString)(download, filename);
	}
	
	void download_didCreateDestination (NSURLDownload download, NSString path)
	{
		return invokeObjcSelf!(void, "download:didCreateDestination:", NSURLDownload, NSString)(download, path);
	}
	
	void downloadDidFinish (NSURLDownload download)
	{
		return invokeObjcSelf!(void, "downloadDidFinish:", NSURLDownload)(download);
	}
	
	void download (NSURLDownload download, NSError error)
	{
		return invokeObjcSelf!(void, "download:didFailWithError:", NSURLDownload, NSError)(download, error);
	}
	
	void parserDidStartDocument (NSXMLParser parser)
	{
		return invokeObjcSelf!(void, "parserDidStartDocument:", NSXMLParser)(parser);
	}
	
	void parserDidEndDocument (NSXMLParser parser)
	{
		return invokeObjcSelf!(void, "parserDidEndDocument:", NSXMLParser)(parser);
	}
	
	void parser (NSXMLParser parser, NSString name, NSString publicID, NSString systemID)
	{
		return invokeObjcSelf!(void, "parser:foundNotationDeclarationWithName:publicID:systemID:", NSXMLParser, NSString, NSString, NSString)(parser, name, publicID, systemID);
	}
	
	void parser (NSXMLParser parser, NSString name, NSString publicID, NSString systemID, NSString notationName)
	{
		return invokeObjcSelf!(void, "parser:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:", NSXMLParser, NSString, NSString, NSString, NSString)(parser, name, publicID, systemID, notationName);
	}
	
	void parser_foundAttributeDeclarationWithName_forElement_type_defaultValue (NSXMLParser parser, NSString attributeName, NSString elementName, NSString type, NSString defaultValue)
	{
		return invokeObjcSelf!(void, "parser:foundAttributeDeclarationWithName:forElement:type:defaultValue:", NSXMLParser, NSString, NSString, NSString, NSString)(parser, attributeName, elementName, type, defaultValue);
	}
	
	void parser (NSXMLParser parser, NSString elementName, NSString model)
	{
		return invokeObjcSelf!(void, "parser:foundElementDeclarationWithName:model:", NSXMLParser, NSString, NSString)(parser, elementName, model);
	}
	
	void parser_foundInternalEntityDeclarationWithName_value (NSXMLParser parser, NSString name, NSString value)
	{
		return invokeObjcSelf!(void, "parser:foundInternalEntityDeclarationWithName:value:", NSXMLParser, NSString, NSString)(parser, name, value);
	}
	
	void parser_foundExternalEntityDeclarationWithName_publicID_systemID (NSXMLParser parser, NSString name, NSString publicID, NSString systemID)
	{
		return invokeObjcSelf!(void, "parser:foundExternalEntityDeclarationWithName:publicID:systemID:", NSXMLParser, NSString, NSString, NSString)(parser, name, publicID, systemID);
	}
	
	void parser (NSXMLParser parser, NSString elementName, NSString namespaceURI, NSString qName, NSDictionary attributeDict)
	{
		return invokeObjcSelf!(void, "parser:didStartElement:namespaceURI:qualifiedName:attributes:", NSXMLParser, NSString, NSString, NSString, NSDictionary)(parser, elementName, namespaceURI, qName, attributeDict);
	}
	
	void parser_didEndElement_namespaceURI_qualifiedName (NSXMLParser parser, NSString elementName, NSString namespaceURI, NSString qName)
	{
		return invokeObjcSelf!(void, "parser:didEndElement:namespaceURI:qualifiedName:", NSXMLParser, NSString, NSString, NSString)(parser, elementName, namespaceURI, qName);
	}
	
	void parser_didStartMappingPrefix_toURI (NSXMLParser parser, NSString prefix, NSString namespaceURI)
	{
		return invokeObjcSelf!(void, "parser:didStartMappingPrefix:toURI:", NSXMLParser, NSString, NSString)(parser, prefix, namespaceURI);
	}
	
	void parser (NSXMLParser parser, NSString prefix)
	{
		return invokeObjcSelf!(void, "parser:didEndMappingPrefix:", NSXMLParser, NSString)(parser, prefix);
	}
	
	void parser_foundCharacter (NSXMLParser parser, NSString string)
	{
		return invokeObjcSelf!(void, "parser:foundCharacters:", NSXMLParser, NSString)(parser, string);
	}
	
	void parser_foundIgnorableWhitespace (NSXMLParser parser, NSString whitespaceString)
	{
		return invokeObjcSelf!(void, "parser:foundIgnorableWhitespace:", NSXMLParser, NSString)(parser, whitespaceString);
	}
	
	void parser_foundProcessingInstructionWithTarget_data (NSXMLParser parser, NSString target, NSString data)
	{
		return invokeObjcSelf!(void, "parser:foundProcessingInstructionWithTarget:data:", NSXMLParser, NSString, NSString)(parser, target, data);
	}
	
	void parser_foundComment (NSXMLParser parser, NSString comment)
	{
		return invokeObjcSelf!(void, "parser:foundComment:", NSXMLParser, NSString)(parser, comment);
	}
	
	void parser (NSXMLParser parser, NSData CDATABlock)
	{
		return invokeObjcSelf!(void, "parser:foundCDATA:", NSXMLParser, NSData)(parser, CDATABlock);
	}
	
	NSData parser_resolveExternalEntityName_systemID (NSXMLParser parser, NSString name, NSString systemID)
	{
		return invokeObjcSelf!(NSData, "parser:resolveExternalEntityName:systemID:", NSXMLParser, NSString, NSString)(parser, name, systemID);
	}
	
	void parser (NSXMLParser parser, NSError parseError)
	{
		return invokeObjcSelf!(void, "parser:parseErrorOccurred:", NSXMLParser, NSError)(parser, parseError);
	}
	
	void parser_validationErrorOccurred (NSXMLParser parser, NSError validationError)
	{
		return invokeObjcSelf!(void, "parser:validationErrorOccurred:", NSXMLParser, NSError)(parser, validationError);
	}
	
	// D extensions
	equals_t opEqual (Object object)
	{
		if (auto str = cast(NSObject) object)
			return isEqual(str);
		
		return false;
	}
}

Object NSAllocateObject (Class aClass, NSUInteger extraBytes, NSZone* zone)
{
	return Bridge.invokeObjcFunction!(Object, bindings.NSAllocateObject, Class, NSUInteger, NSZone*)(aClass, extraBytes, zone);
}

void NSDeallocateObject (Object object)
{
	return Bridge.invokeObjcFunction!(void, bindings.NSDeallocateObject, Object)(object);
}

Object NSCopyObject (Object object, NSUInteger extraBytes, NSZone* zone)
{
	return Bridge.invokeObjcFunction!(Object, bindings.NSCopyObject, Object, NSUInteger, NSZone*)(object, extraBytes, zone);
}

bool NSShouldRetainWithZone (Object anObject, NSZone* requestedZone)
{
	return Bridge.invokeObjcFunction!(bool, bindings.NSShouldRetainWithZone, Object, NSZone*)(anObject, requestedZone);
}

void NSIncrementExtraRefCount (Object object)
{
	return Bridge.invokeObjcFunction!(void, bindings.NSIncrementExtraRefCount, Object)(object);
}

bool NSDecrementExtraRefCountWasZero (Object object)
{
	return Bridge.invokeObjcFunction!(bool, bindings.NSDecrementExtraRefCountWasZero, Object)(object);
}

NSUInteger NSExtraRefCount (Object object)
{
	return Bridge.invokeObjcFunction!(NSUInteger, bindings.NSExtraRefCount, Object)(object);
}