Mercurial > projects > dwt-mac
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/internal/cocoa/NSWindowController.d Sat Aug 09 17:00:02 2008 +0200 @@ -0,0 +1,179 @@ +/******************************************************************************* + * 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 + * + * Port to the D Programming language: + * Jacob Carlborg <jacob.carlborg@gmail.com> + *******************************************************************************/ +module dwt.internal.cocoa.NSWindowController; + +import dwt.internal.cocoa.NSDocument; +import dwt.internal.cocoa.NSResponder; +import dwt.internal.cocoa.NSString; +import dwt.internal.cocoa.NSWindow; +import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; + +public class NSWindowController : NSResponder +{ + + public this () + { + super(); + } + + public this (objc.id id) + { + super(id); + } + + public void close () + { + OS.objc_msgSend(this.id, OS.sel_close); + } + + public id document () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_document); + return result !is null ? new id(result) : null; + } + + public id initWithWindow (NSWindow window) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithWindow_1, window !is null ? window.id : null); + return result !is null ? new id(result) : null; + } + + public id initWithWindowNibName_ (NSString windowNibName) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithWindowNibName_1, windowNibName !is null ? windowNibName.id : null); + return result !is null ? new id(result) : null; + } + + public id initWithWindowNibName_owner_ (NSString windowNibName, id owner) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithWindowNibName_1owner_1, windowNibName !is null ? windowNibName.id : null, + owner !is null ? owner.id : null); + return result !is null ? new id(result) : null; + } + + public id initWithWindowNibPath (NSString windowNibPath, id owner) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithWindowNibPath_1owner_1, windowNibPath !is null ? windowNibPath.id : null, + owner !is null ? owner.id : null); + return result !is null ? new id(result) : null; + } + + public bool isWindowLoaded () + { + return OS.objc_msgSend(this.id, OS.sel_isWindowLoaded) !is null; + } + + public void loadWindow () + { + OS.objc_msgSend(this.id, OS.sel_loadWindow); + } + + public id owner () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_owner); + return result !is null ? new id(result) : null; + } + + public void setDocument (NSDocument document) + { + OS.objc_msgSend(this.id, OS.sel_setDocument_1, document !is null ? document.id : null); + } + + public void setDocumentEdited (bool dirtyFlag) + { + OS.objc_msgSend(this.id, OS.sel_setDocumentEdited_1, dirtyFlag); + } + + public void setShouldCascadeWindows (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setShouldCascadeWindows_1, flag); + } + + public void setShouldCloseDocument (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setShouldCloseDocument_1, flag); + } + + public void setWindow (NSWindow window) + { + OS.objc_msgSend(this.id, OS.sel_setWindow_1, window !is null ? window.id : null); + } + + public void setWindowFrameAutosaveName (NSString name) + { + OS.objc_msgSend(this.id, OS.sel_setWindowFrameAutosaveName_1, name !is null ? name.id : null); + } + + public bool shouldCascadeWindows () + { + return OS.objc_msgSend(this.id, OS.sel_shouldCascadeWindows) !is null; + } + + public bool shouldCloseDocument () + { + return OS.objc_msgSend(this.id, OS.sel_shouldCloseDocument) !is null; + } + + public void showWindow (id sender) + { + OS.objc_msgSend(this.id, OS.sel_showWindow_1, sender !is null ? sender.id : null); + } + + public void synchronizeWindowTitleWithDocumentName () + { + OS.objc_msgSend(this.id, OS.sel_synchronizeWindowTitleWithDocumentName); + } + + public NSWindow window () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_window); + return result !is null ? new NSWindow(result) : null; + } + + public void windowDidLoad () + { + OS.objc_msgSend(this.id, OS.sel_windowDidLoad); + } + + public NSString windowFrameAutosaveName () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_windowFrameAutosaveName); + return result !is null ? new NSString(result) : null; + } + + public NSString windowNibName () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_windowNibName); + return result !is null ? new NSString(result) : null; + } + + public NSString windowNibPath () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_windowNibPath); + return result !is null ? new NSString(result) : null; + } + + public NSString windowTitleForDocumentDisplayName (NSString displayName) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_windowTitleForDocumentDisplayName_1, displayName !is null ? displayName.id : null); + return result !is null ? new NSString(result) : null; + } + + public void windowWillLoad () + { + OS.objc_msgSend(this.id, OS.sel_windowWillLoad); + } + +}