Mercurial > projects > dstep
comparison dstep/appkit/NSViewController.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | b9de51448c6b |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 24, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.appkit.NSViewController; | |
8 | |
9 import dstep.appkit.NSNibDeclarations; | |
10 import dstep.appkit.NSResponder; | |
11 import dstep.appkit.NSView; | |
12 import dstep.foundation.NSArray; | |
13 import dstep.foundation.NSBundle; | |
14 import dstep.foundation.NSString; | |
15 import dstep.objc.bridge.Bridge; | |
16 import dstep.objc.objc; | |
17 | |
18 class NSViewController : NSResponder | |
19 { | |
20 mixin (ObjcWrap); | |
21 | |
22 NSViewController initWithNibName (NSString nibNameOrNil, NSBundle nibBundleOrNil) | |
23 { | |
24 id result = invokeObjcSelf!(id, "initWithNibName:bundle:", NSString, NSBundle)(nibNameOrNil, nibBundleOrNil); | |
25 return result is this.objcObject ? this : (result !is null ? new NSViewController(result) : null); | |
26 } | |
27 | |
28 this (NSString nibNameOrNil, NSBundle nibBundleOrNil) | |
29 { | |
30 super(NSViewController.alloc.initWithNibName(nibNameOrNil, nibBundleOrNil).objcObject); | |
31 } | |
32 | |
33 void setRepresentedObject (Object representedObject) | |
34 { | |
35 return invokeObjcSelf!(void, "setRepresentedObject:", Object)(representedObject); | |
36 } | |
37 | |
38 Object representedObject () | |
39 { | |
40 return invokeObjcSelf!(Object, "representedObject"); | |
41 } | |
42 | |
43 void setTitle (NSString title) | |
44 { | |
45 return invokeObjcSelf!(void, "setTitle:", NSString)(title); | |
46 } | |
47 | |
48 NSString title () | |
49 { | |
50 return invokeObjcSelf!(NSString, "title"); | |
51 } | |
52 | |
53 NSView view () | |
54 { | |
55 return invokeObjcSelf!(NSView, "view"); | |
56 } | |
57 | |
58 void loadView () | |
59 { | |
60 return invokeObjcSelf!(void, "loadView"); | |
61 } | |
62 | |
63 NSString nibName () | |
64 { | |
65 return invokeObjcSelf!(NSString, "nibName"); | |
66 } | |
67 | |
68 NSBundle nibBundle () | |
69 { | |
70 return invokeObjcSelf!(NSBundle, "nibBundle"); | |
71 } | |
72 | |
73 void setView (NSView view) | |
74 { | |
75 return invokeObjcSelf!(void, "setView:", NSView)(view); | |
76 } | |
77 | |
78 void commitEditingWithDelegate (Object delegate_, SEL didCommitSelector, void* contextInfo) | |
79 { | |
80 return invokeObjcSelf!(void, "commitEditingWithDelegate:didCommitSelector:contextInfo:", Object, SEL, void*)(delegate_, didCommitSelector, contextInfo); | |
81 } | |
82 | |
83 bool commitEditing () | |
84 { | |
85 return invokeObjcSelf!(bool, "commitEditing"); | |
86 } | |
87 | |
88 void discardEditing () | |
89 { | |
90 return invokeObjcSelf!(void, "discardEditing"); | |
91 } | |
92 } | |
93 |