summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInvocation.java
blob: d514fd94223ed89f76fd64b9798cfec19f2ee4d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.internal.cocoa;

public class NSInvocation extends NSObject {

public NSInvocation() {
	super();
}

public NSInvocation(int id) {
	super(id);
}

public boolean argumentsRetained() {
	return OS.objc_msgSend(this.id, OS.sel_argumentsRetained) != 0;
}

public void getArgument(int argumentLocation, int idx) {
	OS.objc_msgSend(this.id, OS.sel_getArgument_1atIndex_1, argumentLocation, idx);
}

public void getReturnValue(int retLoc) {
	OS.objc_msgSend(this.id, OS.sel_getReturnValue_1, retLoc);
}

public static NSInvocation invocationWithMethodSignature(NSMethodSignature sig) {
	int result = OS.objc_msgSend(OS.class_NSInvocation, OS.sel_invocationWithMethodSignature_1, sig != null ? sig.id : 0);
	return result != 0 ? new NSInvocation(result) : null;
}

public void invoke() {
	OS.objc_msgSend(this.id, OS.sel_invoke);
}

public void invokeWithTarget(id target) {
	OS.objc_msgSend(this.id, OS.sel_invokeWithTarget_1, target != null ? target.id : 0);
}

public NSMethodSignature methodSignature() {
	int result = OS.objc_msgSend(this.id, OS.sel_methodSignature);
	return result != 0 ? new NSMethodSignature(result) : null;
}

public void retainArguments() {
	OS.objc_msgSend(this.id, OS.sel_retainArguments);
}

public int selector() {
	return OS.objc_msgSend(this.id, OS.sel_selector);
}

public void setArgument(int argumentLocation, int idx) {
	OS.objc_msgSend(this.id, OS.sel_setArgument_1atIndex_1, argumentLocation, idx);
}

public void setReturnValue(int retLoc) {
	OS.objc_msgSend(this.id, OS.sel_setReturnValue_1, retLoc);
}

public void setSelector(int selector) {
	OS.objc_msgSend(this.id, OS.sel_setSelector_1, selector);
}

public void setTarget(id target) {
	OS.objc_msgSend(this.id, OS.sel_setTarget_1, target != null ? target.id : 0);
}

public id target() {
	int result = OS.objc_msgSend(this.id, OS.sel_target);
	return result != 0 ? new id(result) : null;
}

}