diff dstep/foundation/NSInvocation.d @ 14:89f3c3ef1fd2

Added the Foundation framework
author Jacob Carlborg <doob@me.com>
date Mon, 03 Aug 2009 15:23:15 +0200
parents
children 7ff919f595d5
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/foundation/NSInvocation.d	Mon Aug 03 15:23:15 2009 +0200
@@ -0,0 +1,88 @@
+/**
+ * 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.NSInvocation;
+
+import dstep.foundation.NSMethodSignature;
+import dstep.foundation.NSObject;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+import dstep.stdbool;
+
+class NSInvocation : NSObject
+{
+	mixin ObjcWrap;
+
+	static NSInvocation invocationWithMethodSignature (NSMethodSignature sig)
+	{
+		return invokeObjcSelfClass!(NSInvocation, "invocationWithMethodSignature:", NSMethodSignature)(sigreturn result is this.objcObject ? this : (result !is null ? new NSInvocation(result) : null);	}
+
+	NSMethodSignature methodSignature ()
+	{
+		return invokeObjcSelf!(NSMethodSignature, "methodSignature");
+	}
+
+	void retainArguments ()
+	{
+		return invokeObjcSelf!(void, "retainArguments");
+	}
+
+	bool argumentsRetained ()
+	{
+		return invokeObjcSelf!(bool, "argumentsRetained");
+	}
+
+	Object target ()
+	{
+		return invokeObjcSelf!(Object, "target");
+	}
+
+	void setTarget (Object target)
+	{
+		return invokeObjcSelf!(void, "setTarget:", Object)(target);
+	}
+
+	SEL selector ()
+	{
+		return invokeObjcSelf!(SEL, "selector");
+	}
+
+	void setSelector (SEL selector)
+	{
+		return invokeObjcSelf!(void, "setSelector:", SEL)(selector);
+	}
+
+	void getReturnValue (void* retLoc)
+	{
+		return invokeObjcSelf!(void, "getReturnValue:", void*)(retLoc);
+	}
+
+	void setReturnValue (void* retLoc)
+	{
+		return invokeObjcSelf!(void, "setReturnValue:", void*)(retLoc);
+	}
+
+	void getArgument (void* argumentLocation, NSInteger idx)
+	{
+		return invokeObjcSelf!(void, "getArgument:atIndex:", void*, NSInteger)(argumentLocation, idx);
+	}
+
+	void setArgument (void* argumentLocation, NSInteger idx)
+	{
+		return invokeObjcSelf!(void, "setArgument:atIndex:", void*, NSInteger)(argumentLocation, idx);
+	}
+
+	void invoke ()
+	{
+		return invokeObjcSelf!(void, "invoke");
+	}
+
+	void invokeWithTarget (Object target)
+	{
+		return invokeObjcSelf!(void, "invokeWithTarget:", Object)(target);
+	}
+}
+