comparison dwt/internal/cocoa/NSProxy.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSProxy;
15
16 import dwt.internal.cocoa.id;
17 import dwt.internal.cocoa.NSInvocation;
18 import dwt.internal.cocoa.NSMethodSignature;
19 import dwt.internal.cocoa.NSObject;
20 import dwt.internal.cocoa.NSString;
21 import dwt.internal.cocoa.NSZone;
22 import dwt.internal.cocoa.OS;
23 import objc = dwt.internal.objc.runtime;
24
25 public class NSProxy : NSObject
26 {
27
28 public this ()
29 {
30 super();
31 }
32
33 public this (objc.id id)
34 {
35 super(id);
36 }
37
38 //public static id alloc() {
39 // objc.id result = OS.objc_msgSend(OS.class_NSProxy, OS.sel_alloc);
40 // return result !is null ? new id(result) : null;
41 //}
42
43 public static id allocWithZone (NSZone* zone)
44 {
45 objc.id result = OS.objc_msgSend(OS.class_NSProxy, OS.sel_allocWithZone_1, zone);
46 return result !is null ? new id(result) : null;
47 }
48
49 //public static int class() {
50 // return OS.objc_msgSend(OS.class_NSProxy, OS.sel_class);
51 //}
52
53 public void dealloc ()
54 {
55 OS.objc_msgSend(this.id, OS.sel_dealloc);
56 }
57
58 public NSString description ()
59 {
60 objc.id result = OS.objc_msgSend(this.id, OS.sel_description);
61 return result !is null ? new NSString(result) : null;
62 }
63
64 public void finalize ()
65 {
66 OS.objc_msgSend(this.id, OS.sel_finalize);
67 }
68
69 public void forwardInvocation (NSInvocation invocation)
70 {
71 OS.objc_msgSend(this.id, OS.sel_forwardInvocation_1, invocation !is null ? invocation.id : null);
72 }
73
74 public NSMethodSignature methodSignatureForSelector (objc.SEL sel)
75 {
76 objc.id result = OS.objc_msgSend(this.id, OS.sel_methodSignatureForSelector_1, sel);
77 return result !is null ? new NSMethodSignature(result) : null;
78 }
79
80 //public static bool respondsToSelector(int aSelector) {
81 // return OS.objc_msgSend(OS.class_NSProxy, OS.sel_respondsToSelector_1, aSelector) !is null;
82 //}
83
84 }