Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSWindowController.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.NSWindowController; | |
15 | |
16 import dwt.internal.cocoa.NSDocument; | |
17 import dwt.internal.cocoa.NSResponder; | |
18 import dwt.internal.cocoa.NSString; | |
19 import dwt.internal.cocoa.NSWindow; | |
20 import dwt.internal.cocoa.OS; | |
21 import objc = dwt.internal.objc.runtime; | |
22 | |
23 public class NSWindowController : NSResponder | |
24 { | |
25 | |
26 public this () | |
27 { | |
28 super(); | |
29 } | |
30 | |
31 public this (objc.id id) | |
32 { | |
33 super(id); | |
34 } | |
35 | |
36 public void close () | |
37 { | |
38 OS.objc_msgSend(this.id, OS.sel_close); | |
39 } | |
40 | |
41 public id document () | |
42 { | |
43 objc.id result = OS.objc_msgSend(this.id, OS.sel_document); | |
44 return result !is null ? new id(result) : null; | |
45 } | |
46 | |
47 public id initWithWindow (NSWindow window) | |
48 { | |
49 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithWindow_1, window !is null ? window.id : null); | |
50 return result !is null ? new id(result) : null; | |
51 } | |
52 | |
53 public id initWithWindowNibName_ (NSString windowNibName) | |
54 { | |
55 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithWindowNibName_1, windowNibName !is null ? windowNibName.id : null); | |
56 return result !is null ? new id(result) : null; | |
57 } | |
58 | |
59 public id initWithWindowNibName_owner_ (NSString windowNibName, id owner) | |
60 { | |
61 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithWindowNibName_1owner_1, windowNibName !is null ? windowNibName.id : null, | |
62 owner !is null ? owner.id : null); | |
63 return result !is null ? new id(result) : null; | |
64 } | |
65 | |
66 public id initWithWindowNibPath (NSString windowNibPath, id owner) | |
67 { | |
68 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithWindowNibPath_1owner_1, windowNibPath !is null ? windowNibPath.id : null, | |
69 owner !is null ? owner.id : null); | |
70 return result !is null ? new id(result) : null; | |
71 } | |
72 | |
73 public bool isWindowLoaded () | |
74 { | |
75 return OS.objc_msgSend(this.id, OS.sel_isWindowLoaded) !is null; | |
76 } | |
77 | |
78 public void loadWindow () | |
79 { | |
80 OS.objc_msgSend(this.id, OS.sel_loadWindow); | |
81 } | |
82 | |
83 public id owner () | |
84 { | |
85 objc.id result = OS.objc_msgSend(this.id, OS.sel_owner); | |
86 return result !is null ? new id(result) : null; | |
87 } | |
88 | |
89 public void setDocument (NSDocument document) | |
90 { | |
91 OS.objc_msgSend(this.id, OS.sel_setDocument_1, document !is null ? document.id : null); | |
92 } | |
93 | |
94 public void setDocumentEdited (bool dirtyFlag) | |
95 { | |
96 OS.objc_msgSend(this.id, OS.sel_setDocumentEdited_1, dirtyFlag); | |
97 } | |
98 | |
99 public void setShouldCascadeWindows (bool flag) | |
100 { | |
101 OS.objc_msgSend(this.id, OS.sel_setShouldCascadeWindows_1, flag); | |
102 } | |
103 | |
104 public void setShouldCloseDocument (bool flag) | |
105 { | |
106 OS.objc_msgSend(this.id, OS.sel_setShouldCloseDocument_1, flag); | |
107 } | |
108 | |
109 public void setWindow (NSWindow window) | |
110 { | |
111 OS.objc_msgSend(this.id, OS.sel_setWindow_1, window !is null ? window.id : null); | |
112 } | |
113 | |
114 public void setWindowFrameAutosaveName (NSString name) | |
115 { | |
116 OS.objc_msgSend(this.id, OS.sel_setWindowFrameAutosaveName_1, name !is null ? name.id : null); | |
117 } | |
118 | |
119 public bool shouldCascadeWindows () | |
120 { | |
121 return OS.objc_msgSend(this.id, OS.sel_shouldCascadeWindows) !is null; | |
122 } | |
123 | |
124 public bool shouldCloseDocument () | |
125 { | |
126 return OS.objc_msgSend(this.id, OS.sel_shouldCloseDocument) !is null; | |
127 } | |
128 | |
129 public void showWindow (id sender) | |
130 { | |
131 OS.objc_msgSend(this.id, OS.sel_showWindow_1, sender !is null ? sender.id : null); | |
132 } | |
133 | |
134 public void synchronizeWindowTitleWithDocumentName () | |
135 { | |
136 OS.objc_msgSend(this.id, OS.sel_synchronizeWindowTitleWithDocumentName); | |
137 } | |
138 | |
139 public NSWindow window () | |
140 { | |
141 objc.id result = OS.objc_msgSend(this.id, OS.sel_window); | |
142 return result !is null ? new NSWindow(result) : null; | |
143 } | |
144 | |
145 public void windowDidLoad () | |
146 { | |
147 OS.objc_msgSend(this.id, OS.sel_windowDidLoad); | |
148 } | |
149 | |
150 public NSString windowFrameAutosaveName () | |
151 { | |
152 objc.id result = OS.objc_msgSend(this.id, OS.sel_windowFrameAutosaveName); | |
153 return result !is null ? new NSString(result) : null; | |
154 } | |
155 | |
156 public NSString windowNibName () | |
157 { | |
158 objc.id result = OS.objc_msgSend(this.id, OS.sel_windowNibName); | |
159 return result !is null ? new NSString(result) : null; | |
160 } | |
161 | |
162 public NSString windowNibPath () | |
163 { | |
164 objc.id result = OS.objc_msgSend(this.id, OS.sel_windowNibPath); | |
165 return result !is null ? new NSString(result) : null; | |
166 } | |
167 | |
168 public NSString windowTitleForDocumentDisplayName (NSString displayName) | |
169 { | |
170 objc.id result = OS.objc_msgSend(this.id, OS.sel_windowTitleForDocumentDisplayName_1, displayName !is null ? displayName.id : null); | |
171 return result !is null ? new NSString(result) : null; | |
172 } | |
173 | |
174 public void windowWillLoad () | |
175 { | |
176 OS.objc_msgSend(this.id, OS.sel_windowWillLoad); | |
177 } | |
178 | |
179 } |