diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/appkit/NSWindowController.d	Sun Jan 03 22:06:11 2010 +0100
@@ -0,0 +1,194 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Sep 24, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.appkit.NSWindowController;
+
+import dstep.appkit.NSDocument;
+import dstep.appkit.NSNibDeclarations;
+import dstep.appkit.NSResponder;
+import dstep.appkit.NSWindow;
+import dstep.foundation.NSArray;
+import dstep.foundation.NSCoder;
+import dstep.foundation.NSObject;
+import dstep.foundation.NSString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc;
+
+class NSWindowController : NSResponder, INSCoding
+{
+	mixin (ObjcWrap);
+	
+	this (NSCoder aDecoder)
+	{
+		super(typeof(this).alloc.initWithCoder(aDecoder).objcObject);
+	}
+	
+	void encodeWithCoder (NSCoder aCoder)
+	{
+		return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder);
+	}
+	
+	typeof(this) initWithCoder (NSCoder aDecoder)
+	{
+		return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder);
+	}
+
+	NSWindowController initWithWindow (NSWindow window)
+	{
+		id result = invokeObjcSelf!(id, "initWithWindow:", NSWindow)(window);
+		return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
+	}
+
+	this (NSWindow window)
+	{
+		super(NSWindowController.alloc.initWithWindow(window).objcObject);
+	}
+
+	NSWindowController initWithWindowNibName (NSString windowNibName)
+	{
+		id result = invokeObjcSelf!(id, "initWithWindowNibName:", NSString)(windowNibName);
+		return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
+	}
+
+	this (NSString windowNibName)
+	{
+		super(NSWindowController.alloc.initWithWindowNibName(windowNibName).objcObject);
+	}
+
+	NSWindowController initWithWindowNibName (NSString windowNibName, Object owner)
+	{
+		id result = invokeObjcSelf!(id, "initWithWindowNibName:owner:", NSString, Object)(windowNibName, owner);
+		return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
+	}
+
+	this (NSString windowNibName, Object owner)
+	{
+		super(NSWindowController.alloc.initWithWindowNibName(windowNibName, owner).objcObject);
+	}
+
+	NSWindowController initWithWindowNibPath (NSString windowNibPath, Object owner)
+	{
+		id result = invokeObjcSelf!(id, "initWithWindowNibPath:owner:", NSString, Object)(windowNibPath, owner);
+		return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
+	}
+
+	this (NSString windowNibPath, Object owner)
+	{
+		super(NSWindowController.alloc.initWithWindowNibPath(windowNibPath, owner).objcObject);
+	}
+
+	NSString windowNibName ()
+	{
+		return invokeObjcSelf!(NSString, "windowNibName");
+	}
+
+	NSString windowNibPath ()
+	{
+		return invokeObjcSelf!(NSString, "windowNibPath");
+	}
+
+	Object owner ()
+	{
+		return invokeObjcSelf!(Object, "owner");
+	}
+
+	void setWindowFrameAutosaveName (NSString name)
+	{
+		return invokeObjcSelf!(void, "setWindowFrameAutosaveName:", NSString)(name);
+	}
+
+	NSString windowFrameAutosaveName ()
+	{
+		return invokeObjcSelf!(NSString, "windowFrameAutosaveName");
+	}
+
+	void setShouldCascadeWindows (bool flag)
+	{
+		return invokeObjcSelf!(void, "setShouldCascadeWindows:", bool)(flag);
+	}
+
+	bool shouldCascadeWindows ()
+	{
+		return invokeObjcSelf!(bool, "shouldCascadeWindows");
+	}
+
+	Object document ()
+	{
+		return invokeObjcSelf!(Object, "document");
+	}
+
+	void setDocument (NSDocument document)
+	{
+		return invokeObjcSelf!(void, "setDocument:", NSDocument)(document);
+	}
+
+	void setDocumentEdited (bool dirtyFlag)
+	{
+		return invokeObjcSelf!(void, "setDocumentEdited:", bool)(dirtyFlag);
+	}
+
+	void setShouldCloseDocument (bool flag)
+	{
+		return invokeObjcSelf!(void, "setShouldCloseDocument:", bool)(flag);
+	}
+
+	bool shouldCloseDocument ()
+	{
+		return invokeObjcSelf!(bool, "shouldCloseDocument");
+	}
+
+	void setWindow (NSWindow window)
+	{
+		return invokeObjcSelf!(void, "setWindow:", NSWindow)(window);
+	}
+
+	NSWindow window ()
+	{
+		return invokeObjcSelf!(NSWindow, "window");
+	}
+
+	void synchronizeWindowTitleWithDocumentName ()
+	{
+		return invokeObjcSelf!(void, "synchronizeWindowTitleWithDocumentName");
+	}
+
+	NSString windowTitleForDocumentDisplayName (NSString displayName)
+	{
+		return invokeObjcSelf!(NSString, "windowTitleForDocumentDisplayName:", NSString)(displayName);
+	}
+
+	void close ()
+	{
+		return invokeObjcSelf!(void, "close");
+	}
+
+	void showWindow (Object sender)
+	{
+		return invokeObjcSelf!(void, "showWindow:", Object)(sender);
+	}
+
+	bool isWindowLoaded ()
+	{
+		return invokeObjcSelf!(bool, "isWindowLoaded");
+	}
+
+	void windowWillLoad ()
+	{
+		return invokeObjcSelf!(void, "windowWillLoad");
+	}
+
+	void windowDidLoad ()
+	{
+		return invokeObjcSelf!(void, "windowDidLoad");
+	}
+
+	void loadWindow ()
+	{
+		return invokeObjcSelf!(void, "loadWindow");
+	}
+
+}
+