comparison dstep/appkit/NSWindowController.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 f8a3b67adfcb
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.NSWindowController;
8
9 import dstep.appkit.NSDocument;
10 import dstep.appkit.NSNibDeclarations;
11 import dstep.appkit.NSResponder;
12 import dstep.appkit.NSWindow;
13 import dstep.foundation.NSArray;
14 import dstep.foundation.NSCoder;
15 import dstep.foundation.NSObject;
16 import dstep.foundation.NSString;
17 import dstep.objc.bridge.Bridge;
18 import dstep.objc.objc;
19
20 class NSWindowController : NSResponder, INSCoding
21 {
22 mixin (ObjcWrap);
23
24 this (NSCoder aDecoder)
25 {
26 super(typeof(this).alloc.initWithCoder(aDecoder).objcObject);
27 }
28
29 void encodeWithCoder (NSCoder aCoder)
30 {
31 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder);
32 }
33
34 typeof(this) initWithCoder (NSCoder aDecoder)
35 {
36 return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder);
37 }
38
39 NSWindowController initWithWindow (NSWindow window)
40 {
41 id result = invokeObjcSelf!(id, "initWithWindow:", NSWindow)(window);
42 return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
43 }
44
45 this (NSWindow window)
46 {
47 super(NSWindowController.alloc.initWithWindow(window).objcObject);
48 }
49
50 NSWindowController initWithWindowNibName (NSString windowNibName)
51 {
52 id result = invokeObjcSelf!(id, "initWithWindowNibName:", NSString)(windowNibName);
53 return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
54 }
55
56 this (NSString windowNibName)
57 {
58 super(NSWindowController.alloc.initWithWindowNibName(windowNibName).objcObject);
59 }
60
61 NSWindowController initWithWindowNibName (NSString windowNibName, Object owner)
62 {
63 id result = invokeObjcSelf!(id, "initWithWindowNibName:owner:", NSString, Object)(windowNibName, owner);
64 return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
65 }
66
67 this (NSString windowNibName, Object owner)
68 {
69 super(NSWindowController.alloc.initWithWindowNibName(windowNibName, owner).objcObject);
70 }
71
72 NSWindowController initWithWindowNibPath (NSString windowNibPath, Object owner)
73 {
74 id result = invokeObjcSelf!(id, "initWithWindowNibPath:owner:", NSString, Object)(windowNibPath, owner);
75 return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
76 }
77
78 this (NSString windowNibPath, Object owner)
79 {
80 super(NSWindowController.alloc.initWithWindowNibPath(windowNibPath, owner).objcObject);
81 }
82
83 NSString windowNibName ()
84 {
85 return invokeObjcSelf!(NSString, "windowNibName");
86 }
87
88 NSString windowNibPath ()
89 {
90 return invokeObjcSelf!(NSString, "windowNibPath");
91 }
92
93 Object owner ()
94 {
95 return invokeObjcSelf!(Object, "owner");
96 }
97
98 void setWindowFrameAutosaveName (NSString name)
99 {
100 return invokeObjcSelf!(void, "setWindowFrameAutosaveName:", NSString)(name);
101 }
102
103 NSString windowFrameAutosaveName ()
104 {
105 return invokeObjcSelf!(NSString, "windowFrameAutosaveName");
106 }
107
108 void setShouldCascadeWindows (bool flag)
109 {
110 return invokeObjcSelf!(void, "setShouldCascadeWindows:", bool)(flag);
111 }
112
113 bool shouldCascadeWindows ()
114 {
115 return invokeObjcSelf!(bool, "shouldCascadeWindows");
116 }
117
118 Object document ()
119 {
120 return invokeObjcSelf!(Object, "document");
121 }
122
123 void setDocument (NSDocument document)
124 {
125 return invokeObjcSelf!(void, "setDocument:", NSDocument)(document);
126 }
127
128 void setDocumentEdited (bool dirtyFlag)
129 {
130 return invokeObjcSelf!(void, "setDocumentEdited:", bool)(dirtyFlag);
131 }
132
133 void setShouldCloseDocument (bool flag)
134 {
135 return invokeObjcSelf!(void, "setShouldCloseDocument:", bool)(flag);
136 }
137
138 bool shouldCloseDocument ()
139 {
140 return invokeObjcSelf!(bool, "shouldCloseDocument");
141 }
142
143 void setWindow (NSWindow window)
144 {
145 return invokeObjcSelf!(void, "setWindow:", NSWindow)(window);
146 }
147
148 NSWindow window ()
149 {
150 return invokeObjcSelf!(NSWindow, "window");
151 }
152
153 void synchronizeWindowTitleWithDocumentName ()
154 {
155 return invokeObjcSelf!(void, "synchronizeWindowTitleWithDocumentName");
156 }
157
158 NSString windowTitleForDocumentDisplayName (NSString displayName)
159 {
160 return invokeObjcSelf!(NSString, "windowTitleForDocumentDisplayName:", NSString)(displayName);
161 }
162
163 void close ()
164 {
165 return invokeObjcSelf!(void, "close");
166 }
167
168 void showWindow (Object sender)
169 {
170 return invokeObjcSelf!(void, "showWindow:", Object)(sender);
171 }
172
173 bool isWindowLoaded ()
174 {
175 return invokeObjcSelf!(bool, "isWindowLoaded");
176 }
177
178 void windowWillLoad ()
179 {
180 return invokeObjcSelf!(void, "windowWillLoad");
181 }
182
183 void windowDidLoad ()
184 {
185 return invokeObjcSelf!(void, "windowDidLoad");
186 }
187
188 void loadWindow ()
189 {
190 return invokeObjcSelf!(void, "loadWindow");
191 }
192
193 }
194