annotate dstep/appkit/NSDocument.d @ 22:f8a3b67adfcb

Removed duplicated methods
author Jacob Carlborg <doob@me.com>
date Tue, 09 Feb 2010 18:02:03 +0100
parents 19885b43130e
children b9de51448c6b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
1 /**
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
3 * Authors: Jacob Carlborg
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
4 * Version: Initial created: Sep 24, 2009
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
6 */
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
7 module dstep.appkit.NSDocument;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
8
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
9 import dstep.appkit.NSDocumentScripting;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
10 import dstep.appkit.NSFileWrapper;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
11 import dstep.appkit.NSMenuItem;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
12 import dstep.appkit.NSNibDeclarations;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
13 import dstep.appkit.NSPageLayout;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
14 import dstep.appkit.NSPrintInfo;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
15 import dstep.appkit.NSPrintOperation;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
16 import dstep.appkit.NSSavePanel;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
17 import dstep.appkit.NSUserInterfaceValidation;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
18 import dstep.appkit.NSView;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
19 import dstep.appkit.NSWindow;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
20 import dstep.appkit.NSWindowController;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
21 import dstep.foundation.NSArray;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
22 import dstep.foundation.NSData;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
23 import dstep.foundation.NSDate;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
24 import dstep.foundation.NSDictionary;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
25 import dstep.foundation.NSError;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
26 import dstep.foundation.NSObjCRuntime;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
27 import dstep.foundation.NSObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
28 import dstep.foundation.NSScriptCommand;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
29 import dstep.foundation.NSScriptObjectSpecifiers;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
30 import dstep.foundation.NSScriptStandardSuiteCommands;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
31 import dstep.foundation.NSString;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
32 import dstep.foundation.NSUndoManager;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
33 import dstep.foundation.NSURL;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
34 import dstep.objc.bridge.Bridge;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
35 import dstep.objc.objc;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
36
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
37 alias NSUInteger NSDocumentChangeType;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
38 alias NSUInteger NSSaveOperationType;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
39
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
40 enum
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
41 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
42 NSChangeDone = 0,
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
43 NSChangeUndone = 1,
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
44 NSChangeCleared = 2,
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
45 NSChangeRedone = 5,
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
46 NSChangeReadOtherContents = 3,
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
47 NSChangeAutosaved = 4
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
48 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
49
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
50 enum
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
51 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
52 NSSaveOperation = 0,
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
53 NSSaveAsOperation = 1,
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
54 NSSaveToOperation = 2,
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
55 NSAutosaveOperation = 3
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
56 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
57
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
58 const TNSDeprecated = `
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
59
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
60 NSData dataRepresentationOfType (NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
61 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
62 return invokeObjcSelf!(NSData, "dataRepresentationOfType:", NSString)(type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
63 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
64
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
65 NSDictionary fileAttributesToWriteToFile (NSString fullDocumentPath, NSString documentTypeName, uint saveOperationType)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
66 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
67 return invokeObjcSelf!(NSDictionary, "fileAttributesToWriteToFile:ofType:saveOperation:", NSString, NSString, uint)(fullDocumentPath, documentTypeName, saveOperationType);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
68 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
69
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
70 NSString fileName ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
71 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
72 return invokeObjcSelf!(NSString, "fileName");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
73 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
74
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
75 NSFileWrapper fileWrapperRepresentationOfType (NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
76 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
77 return invokeObjcSelf!(NSFileWrapper, "fileWrapperRepresentationOfType:", NSString)(type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
78 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
79
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
80 typeof(this) initWithContentsOfFile (NSString absolutePath, NSString typeName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
81 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
82 id result = invokeObjcSelf!(id, "initWithContentsOfFile:ofType:", NSString, NSString)(absolutePath, typeName);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
83 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
84 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
85
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
86 this (NSString absolutePath, NSString typeName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
87 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
88 super(typeof(this).alloc.initWithContentsOfFile(absolutePath, typeName).objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
89 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
90
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
91 typeof(this) initWithContentsOfURL (NSURL absoluteURL, NSString typeName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
92 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
93 id result = invokeObjcSelf!(id, "initWithContentsOfURL:ofType:", NSURL, NSString)(absoluteURL, typeName);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
94 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
95 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
96
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
97 this (NSURL absoluteURL, NSString typeName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
98 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
99 super(typeof(this).alloc.initWithContentsOfURL(absoluteURL, typeName).objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
100 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
101
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
102 bool loadDataRepresentation (NSData data, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
103 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
104 return invokeObjcSelf!(bool, "loadDataRepresentation:ofType:", NSData, NSString)(data, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
105 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
106
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
107 bool loadFileWrapperRepresentation (NSFileWrapper wrapper, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
108 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
109 return invokeObjcSelf!(bool, "loadFileWrapperRepresentation:ofType:", NSFileWrapper, NSString)(wrapper, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
110 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
111
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
112 void printShowingPrintPanel (bool flag)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
113 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
114 return invokeObjcSelf!(void, "printShowingPrintPanel:", bool)(flag);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
115 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
116
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
117 bool readFromFile (NSString fileName, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
118 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
119 return invokeObjcSelf!(bool, "readFromFile:ofType:", NSString, NSString)(fileName, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
120 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
121
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
122 bool readFromURL (NSURL url, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
123 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
124 return invokeObjcSelf!(bool, "readFromURL:ofType:", NSURL, NSString)(url, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
125 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
126
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
127 bool revertToSavedFromFile (NSString fileName, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
128 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
129 return invokeObjcSelf!(bool, "revertToSavedFromFile:ofType:", NSString, NSString)(fileName, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
130 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
131
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
132 bool revertToSavedFromURL (NSURL url, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
133 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
134 return invokeObjcSelf!(bool, "revertToSavedFromURL:ofType:", NSURL, NSString)(url, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
135 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
136
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
137 NSInteger runModalPageLayoutWithPrintInfo (NSPrintInfo printInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
138 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
139 return invokeObjcSelf!(NSInteger, "runModalPageLayoutWithPrintInfo:", NSPrintInfo)(printInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
140 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
141
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
142 void saveToFile (NSString fileName, uint saveOperation, Object delegate_, SEL didSaveSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
143 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
144 return invokeObjcSelf!(void, "saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:", NSString, uint, Object, SEL, void*)(fileName, saveOperation, delegate_, didSaveSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
145 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
146
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
147 void setFileName (NSString fileName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
148 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
149 return invokeObjcSelf!(void, "setFileName:", NSString)(fileName);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
150 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
151
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
152 bool writeToFile (NSString fileName, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
153 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
154 return invokeObjcSelf!(bool, "writeToFile:ofType:", NSString, NSString)(fileName, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
155 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
156
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
157 bool writeToFile (NSString fullDocumentPath, NSString documentTypeName, NSString fullOriginalDocumentPath, uint saveOperationType)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
158 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
159 return invokeObjcSelf!(bool, "writeToFile:ofType:originalFile:saveOperation:", NSString, NSString, NSString, uint)(fullDocumentPath, documentTypeName, fullOriginalDocumentPath, saveOperationType);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
160 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
161
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
162 bool writeToURL (NSURL url, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
163 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
164 return invokeObjcSelf!(bool, "writeToURL:ofType:", NSURL, NSString)(url, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
165 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
166
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
167 bool writeWithBackupToFile (NSString fullDocumentPath, NSString documentTypeName, uint saveOperationType)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
168 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
169 return invokeObjcSelf!(bool, "writeWithBackupToFile:ofType:saveOperation:", NSString, NSString, uint)(fullDocumentPath, documentTypeName, saveOperationType);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
170 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
171
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
172 //mixin ObjcBindMethod!(dataRepresentationOfType, "dataRepresentationOfType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
173 //mixin ObjcBindMethod!(fileAttributesToWriteToFile, "fileAttributesToWriteToFile:ofType:saveOperation:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
174 //mixin ObjcBindMethod!(fileName, "fileName");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
175 //mixin ObjcBindMethod!(fileWrapperRepresentationOfType, "fileWrapperRepresentationOfType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
176 //mixin ObjcBindMethod!(initWithContentsOfFile, "initWithContentsOfFile:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
177 //mixin ObjcBindMethod!(initWithContentsOfURL, "initWithContentsOfURL:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
178 //mixin ObjcBindMethod!(loadDataRepresentation, "loadDataRepresentation:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
179 //mixin ObjcBindMethod!(loadFileWrapperRepresentation, "loadFileWrapperRepresentation:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
180 //mixin ObjcBindMethod!(printShowingPrintPanel, "printShowingPrintPanel:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
181 //mixin ObjcBindMethod!(readFromFile, "readFromFile:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
182 ////mixin ObjcBindMethod!(readFromURL, "readFromURL:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
183 //mixin ObjcBindMethod!(revertToSavedFromFile, "revertToSavedFromFile:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
184 //mixin ObjcBindMethod!(revertToSavedFromURL, "revertToSavedFromURL:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
185 //mixin ObjcBindMethod!(runModalPageLayoutWithPrintInfo, "runModalPageLayoutWithPrintInfo:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
186 //mixin ObjcBindMethod!(saveToFile, "saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
187 //mixin ObjcBindMethod!(setFileName, "setFileName:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
188 //mixin ObjcBindMethod!(writeToFile, "writeToFile:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
189 //mixin ObjcBindMethod!(writeToFile, "writeToFile:ofType:originalFile:saveOperation:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
190 ////mixin ObjcBindMethod!(writeToURL, "writeToURL:ofType:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
191 //mixin ObjcBindMethod!(writeWithBackupToFile, "writeWithBackupToFile:ofType:saveOperation:");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
192
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
193 `;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
194
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
195 class NSDocument : NSObject, INSUserInterfaceValidations
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
196 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
197 mixin (ObjcWrap);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
198
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
199 NSDocument init ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
200 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
201 id result = invokeObjcSelf!(id, "init");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
202 return result is this.objcObject ? this : (result !is null ? new NSDocument(result) : null);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
203 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
204
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
205 this ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
206 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
207 super(NSDocument.alloc.init.objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
208 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
209
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
210 NSDocument initWithType (NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
211 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
212 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
213
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
214 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
215 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
216
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
217 id result = invokeObjcSelf!(id, "initWithType:error:", NSString, id*)(typeName, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
218
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
219 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
220 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
221
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
222 return result is this.objcObject ? this : (result !is null ? new NSDocument(result) : null);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
223 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
224
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
225 this (NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
226 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
227 super(NSDocument.alloc.initWithType(typeName, outError).objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
228 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
229
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
230 NSDocument initForURL (NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
231 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
232 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
233
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
234 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
235 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
236
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
237 id result = invokeObjcSelf!(id, "initForURL:withContentsOfURL:ofType:error:", NSURL, NSURL, NSString, id*)(absoluteDocumentURL, absoluteDocumentContentsURL, typeName, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
238
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
239 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
240 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
241
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
242 return result is this.objcObject ? this : (result !is null ? new NSDocument(result) : null);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
243 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
244
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
245 this (NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
246 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
247 super(NSDocument.alloc.initForURL(absoluteDocumentURL, absoluteDocumentContentsURL, typeName, outError).objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
248 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
249
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
250 void setFileType (NSString typeName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
251 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
252 return invokeObjcSelf!(void, "setFileType:", NSString)(typeName);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
253 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
254
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
255 NSString fileType ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
256 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
257 return invokeObjcSelf!(NSString, "fileType");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
258 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
259
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
260 void setFileURL (NSURL absoluteURL)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
261 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
262 return invokeObjcSelf!(void, "setFileURL:", NSURL)(absoluteURL);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
263 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
264
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
265 NSURL fileURL ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
266 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
267 return invokeObjcSelf!(NSURL, "fileURL");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
268 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
269
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
270 void setFileModificationDate (NSDate modificationDate)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
271 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
272 return invokeObjcSelf!(void, "setFileModificationDate:", NSDate)(modificationDate);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
273 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
274
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
275 NSDate fileModificationDate ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
276 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
277 return invokeObjcSelf!(NSDate, "fileModificationDate");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
278 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
279
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
280 void revertDocumentToSaved (Object sender)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
281 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
282 return invokeObjcSelf!(void, "revertDocumentToSaved:", Object)(sender);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
283 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
284
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
285 bool revertToContentsOfURL (NSURL absoluteURL, NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
286 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
287 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
288
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
289 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
290 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
291
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
292 bool result = invokeObjcSelf!(bool, "revertToContentsOfURL:ofType:error:", NSURL, NSString, id*)(absoluteURL, typeName, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
293
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
294 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
295 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
296
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
297 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
298 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
299
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
300 bool readFromURL (NSURL absoluteURL, NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
301 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
302 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
303
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
304 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
305 error = outError.objcObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
306
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
307 bool result = invokeObjcSelf!(bool, "readFromURL:ofType:error:", NSURL, NSString, id*)(absoluteURL, typeName, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
308
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
309 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
310 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
311
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
312 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
313 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
314
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
315 bool readFromFileWrapper (NSFileWrapper fileWrapper, NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
316 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
317 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
318
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
319 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
320 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
321
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
322 bool result = invokeObjcSelf!(bool, "readFromFileWrapper:ofType:error:", NSFileWrapper, NSString, id*)(fileWrapper, typeName, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
323
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
324 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
325 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
326
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
327 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
328 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
329
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
330 bool readFromData (NSData data, NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
331 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
332 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
333
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
334 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
335 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
336
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
337 bool result = invokeObjcSelf!(bool, "readFromData:ofType:error:", NSData, NSString, id*)(data, typeName, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
338
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
339 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
340 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
341
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
342 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
343 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
344
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
345 bool writeToURL (NSURL absoluteURL, NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
346 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
347 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
348
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
349 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
350 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
351
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
352 bool result = invokeObjcSelf!(bool, "writeToURL:ofType:error:", NSURL, NSString, id*)(absoluteURL, typeName, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
353
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
354 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
355 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
356
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
357 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
358 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
359
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
360 NSFileWrapper fileWrapperOfType (NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
361 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
362 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
363
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
364 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
365 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
366
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
367 NSFileWrapper result = invokeObjcSelf!(NSFileWrapper, "fileWrapperOfType:error:", NSString, id*)(typeName, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
368
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
369 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
370 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
371
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
372 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
373 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
374
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
375 NSData dataOfType (NSString typeName, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
376 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
377 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
378
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
379 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
380 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
381
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
382 NSData result = invokeObjcSelf!(NSData, "dataOfType:error:", NSString, id*)(typeName, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
383
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
384 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
385 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
386
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
387 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
388 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
389
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
390 bool writeSafelyToURL (NSURL absoluteURL, NSString typeName, uint saveOperation, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
391 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
392 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
393
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
394 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
395 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
396
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
397 bool result = invokeObjcSelf!(bool, "writeSafelyToURL:ofType:forSaveOperation:error:", NSURL, NSString, uint, id*)(absoluteURL, typeName, saveOperation, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
398
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
399 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
400 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
401
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
402 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
403 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
404
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
405 bool writeToURL (NSURL absoluteURL, NSString typeName, uint saveOperation, NSURL absoluteOriginalContentsURL, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
406 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
407 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
408
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
409 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
410 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
411
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
412 bool result = invokeObjcSelf!(bool, "writeToURL:ofType:forSaveOperation:originalContentsURL:error:", NSURL, NSString, uint, NSURL, id*)(absoluteURL, typeName, saveOperation, absoluteOriginalContentsURL, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
413
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
414 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
415 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
416
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
417 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
418 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
419
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
420 NSDictionary fileAttributesToWriteToURL (NSURL absoluteURL, NSString typeName, uint saveOperation, NSURL absoluteOriginalContentsURL, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
421 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
422 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
423
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
424 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
425 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
426
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
427 NSDictionary result = invokeObjcSelf!(NSDictionary, "fileAttributesToWriteToURL:ofType:forSaveOperation:originalContentsURL:error:", NSURL, NSString, uint, NSURL, id*)(absoluteURL, typeName, saveOperation, absoluteOriginalContentsURL, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
428
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
429 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
430 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
431
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
432 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
433 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
434
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
435 bool keepBackupFile ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
436 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
437 return invokeObjcSelf!(bool, "keepBackupFile");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
438 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
439
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
440 void saveDocument (Object sender)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
441 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
442 return invokeObjcSelf!(void, "saveDocument:", Object)(sender);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
443 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
444
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
445 void saveDocumentAs (Object sender)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
446 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
447 return invokeObjcSelf!(void, "saveDocumentAs:", Object)(sender);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
448 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
449
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
450 void saveDocumentTo (Object sender)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
451 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
452 return invokeObjcSelf!(void, "saveDocumentTo:", Object)(sender);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
453 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
454
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
455 void saveDocumentWithDelegate (Object delegate_, SEL didSaveSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
456 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
457 return invokeObjcSelf!(void, "saveDocumentWithDelegate:didSaveSelector:contextInfo:", Object, SEL, void*)(delegate_, didSaveSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
458 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
459
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
460 void runModalSavePanelForSaveOperation (uint saveOperation, Object delegate_, SEL didSaveSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
461 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
462 return invokeObjcSelf!(void, "runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:", uint, Object, SEL, void*)(saveOperation, delegate_, didSaveSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
463 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
464
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
465 bool shouldRunSavePanelWithAccessoryView ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
466 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
467 return invokeObjcSelf!(bool, "shouldRunSavePanelWithAccessoryView");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
468 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
469
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
470 bool prepareSavePanel (NSSavePanel savePanel)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
471 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
472 return invokeObjcSelf!(bool, "prepareSavePanel:", NSSavePanel)(savePanel);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
473 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
474
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
475 bool fileNameExtensionWasHiddenInLastRunSavePanel ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
476 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
477 return invokeObjcSelf!(bool, "fileNameExtensionWasHiddenInLastRunSavePanel");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
478 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
479
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
480 NSString fileTypeFromLastRunSavePanel ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
481 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
482 return invokeObjcSelf!(NSString, "fileTypeFromLastRunSavePanel");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
483 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
484
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
485 void saveToURL (NSURL absoluteURL, NSString typeName, uint saveOperation, Object delegate_, SEL didSaveSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
486 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
487 return invokeObjcSelf!(void, "saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:", NSURL, NSString, uint, Object, SEL, void*)(absoluteURL, typeName, saveOperation, delegate_, didSaveSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
488 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
489
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
490 bool saveToURL (NSURL absoluteURL, NSString typeName, uint saveOperation, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
491 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
492 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
493
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
494 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
495 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
496
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
497 bool result = invokeObjcSelf!(bool, "saveToURL:ofType:forSaveOperation:error:", NSURL, NSString, uint, id*)(absoluteURL, typeName, saveOperation, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
498
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
499 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
500 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
501
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
502 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
503 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
504
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
505 bool hasUnautosavedChanges ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
506 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
507 return invokeObjcSelf!(bool, "hasUnautosavedChanges");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
508 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
509
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
510 void autosaveDocumentWithDelegate (Object delegate_, SEL didAutosaveSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
511 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
512 return invokeObjcSelf!(void, "autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo:", Object, SEL, void*)(delegate_, didAutosaveSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
513 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
514
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
515 NSString autosavingFileType ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
516 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
517 return invokeObjcSelf!(NSString, "autosavingFileType");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
518 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
519
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
520 void setAutosavedContentsFileURL (NSURL absoluteURL)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
521 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
522 return invokeObjcSelf!(void, "setAutosavedContentsFileURL:", NSURL)(absoluteURL);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
523 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
524
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
525 NSURL autosavedContentsFileURL ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
526 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
527 return invokeObjcSelf!(NSURL, "autosavedContentsFileURL");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
528 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
529
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
530 void canCloseDocumentWithDelegate (Object delegate_, SEL shouldCloseSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
531 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
532 return invokeObjcSelf!(void, "canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:", Object, SEL, void*)(delegate_, shouldCloseSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
533 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
534
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
535 void close ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
536 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
537 return invokeObjcSelf!(void, "close");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
538 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
539
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
540 void runPageLayout (Object sender)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
541 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
542 return invokeObjcSelf!(void, "runPageLayout:", Object)(sender);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
543 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
544
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
545 void runModalPageLayoutWithPrintInfo (NSPrintInfo printInfo, Object delegate_, SEL didRunSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
546 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
547 return invokeObjcSelf!(void, "runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:", NSPrintInfo, Object, SEL, void*)(printInfo, delegate_, didRunSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
548 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
549
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
550 bool preparePageLayout (NSPageLayout pageLayout)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
551 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
552 return invokeObjcSelf!(bool, "preparePageLayout:", NSPageLayout)(pageLayout);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
553 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
554
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
555 bool shouldChangePrintInfo (NSPrintInfo newPrintInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
556 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
557 return invokeObjcSelf!(bool, "shouldChangePrintInfo:", NSPrintInfo)(newPrintInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
558 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
559
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
560 void setPrintInfo (NSPrintInfo printInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
561 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
562 return invokeObjcSelf!(void, "setPrintInfo:", NSPrintInfo)(printInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
563 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
564
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
565 NSPrintInfo printInfo ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
566 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
567 return invokeObjcSelf!(NSPrintInfo, "printInfo");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
568 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
569
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
570 void printDocument (Object sender)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
571 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
572 return invokeObjcSelf!(void, "printDocument:", Object)(sender);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
573 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
574
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
575 void printDocumentWithSettings (NSDictionary printSettings, bool showPrintPanel, Object delegate_, SEL didPrintSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
576 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
577 return invokeObjcSelf!(void, "printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo:", NSDictionary, bool, Object, SEL, void*)(printSettings, showPrintPanel, delegate_, didPrintSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
578 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
579
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
580 NSPrintOperation printOperationWithSettings (NSDictionary printSettings, ref NSError outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
581 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
582 id error;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
583
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
584 if (outError)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
585 error = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
586
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
587 NSPrintOperation result = invokeObjcSelf!(NSPrintOperation, "printOperationWithSettings:error:", NSDictionary, id*)(printSettings, &error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
588
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
589 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
590 outError = new NSError(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
591
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
592 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
593 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
594
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
595 void runModalPrintOperation (NSPrintOperation printOperation, Object delegate_, SEL didRunSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
596 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
597 return invokeObjcSelf!(void, "runModalPrintOperation:delegate:didRunSelector:contextInfo:", NSPrintOperation, Object, SEL, void*)(printOperation, delegate_, didRunSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
598 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
599
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
600 bool isDocumentEdited ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
601 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
602 return invokeObjcSelf!(bool, "isDocumentEdited");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
603 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
604
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
605 void updateChangeCount (uint change)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
606 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
607 return invokeObjcSelf!(void, "updateChangeCount:", uint)(change);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
608 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
609
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
610 void setUndoManager (NSUndoManager undoManager)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
611 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
612 return invokeObjcSelf!(void, "setUndoManager:", NSUndoManager)(undoManager);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
613 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
614
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
615 NSUndoManager undoManager ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
616 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
617 return invokeObjcSelf!(NSUndoManager, "undoManager");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
618 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
619
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
620 void setHasUndoManager (bool hasUndoManager)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
621 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
622 return invokeObjcSelf!(void, "setHasUndoManager:", bool)(hasUndoManager);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
623 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
624
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
625 bool hasUndoManager ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
626 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
627 return invokeObjcSelf!(bool, "hasUndoManager");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
628 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
629
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
630 void presentError (NSError error, NSWindow window, Object delegate_, SEL didPresentSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
631 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
632 return invokeObjcSelf!(void, "presentError:modalForWindow:delegate:didPresentSelector:contextInfo:", NSError, NSWindow, Object, SEL, void*)(error, window, delegate_, didPresentSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
633 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
634
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
635 bool presentError (NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
636 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
637 return invokeObjcSelf!(bool, "presentError:", NSError)(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
638 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
639
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
640 NSError willPresentError (NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
641 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
642 return invokeObjcSelf!(NSError, "willPresentError:", NSError)(error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
643 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
644
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
645 void makeWindowControllers ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
646 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
647 return invokeObjcSelf!(void, "makeWindowControllers");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
648 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
649
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
650 NSString windowNibName ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
651 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
652 return invokeObjcSelf!(NSString, "windowNibName");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
653 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
654
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
655 void windowControllerWillLoadNib (NSWindowController windowController)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
656 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
657 return invokeObjcSelf!(void, "windowControllerWillLoadNib:", NSWindowController)(windowController);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
658 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
659
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
660 void windowControllerDidLoadNib (NSWindowController windowController)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
661 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
662 return invokeObjcSelf!(void, "windowControllerDidLoadNib:", NSWindowController)(windowController);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
663 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
664
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
665 void setWindow (NSWindow window)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
666 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
667 return invokeObjcSelf!(void, "setWindow:", NSWindow)(window);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
668 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
669
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
670 void addWindowController (NSWindowController windowController)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
671 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
672 return invokeObjcSelf!(void, "addWindowController:", NSWindowController)(windowController);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
673 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
674
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
675 void removeWindowController (NSWindowController windowController)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
676 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
677 return invokeObjcSelf!(void, "removeWindowController:", NSWindowController)(windowController);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
678 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
679
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
680 void showWindows ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
681 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
682 return invokeObjcSelf!(void, "showWindows");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
683 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
684
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
685 NSArray windowControllers ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
686 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
687 return invokeObjcSelf!(NSArray, "windowControllers");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
688 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
689
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
690 void shouldCloseWindowController (NSWindowController windowController, Object delegate_, SEL shouldCloseSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
691 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
692 return invokeObjcSelf!(void, "shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:", NSWindowController, Object, SEL, void*)(windowController, delegate_, shouldCloseSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
693 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
694
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
695 NSString displayName ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
696 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
697 return invokeObjcSelf!(NSString, "displayName");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
698 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
699
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
700 NSWindow windowForSheet ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
701 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
702 return invokeObjcSelf!(NSWindow, "windowForSheet");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
703 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
704
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
705 static NSArray readableTypes ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
706 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
707 return invokeObjcSelfClass!(NSArray, "readableTypes");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
708 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
709
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
710 static NSArray writableTypes ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
711 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
712 return invokeObjcSelfClass!(NSArray, "writableTypes");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
713 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
714
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
715 static bool isNativeType (NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
716 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
717 return invokeObjcSelfClass!(bool, "isNativeType:", NSString)(type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
718 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
719
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
720 NSArray writableTypesForSaveOperation (uint saveOperation)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
721 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
722 return invokeObjcSelf!(NSArray, "writableTypesForSaveOperation:", uint)(saveOperation);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
723 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
724
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
725 NSString fileNameExtensionForType (NSString typeName, uint saveOperation)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
726 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
727 return invokeObjcSelf!(NSString, "fileNameExtensionForType:saveOperation:", NSString, uint)(typeName, saveOperation);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
728 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
729
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
730 bool validateUserInterfaceItem (INSValidatedUserInterfaceItem anItem)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
731 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
732 return invokeObjcSelf!(bool, "validateUserInterfaceItem:", INSValidatedUserInterfaceItem)(anItem);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
733 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
734
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
735 // NSDeprecated
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
736 NSData dataRepresentationOfType (NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
737 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
738 return invokeObjcSelf!(NSData, "dataRepresentationOfType:", NSString)(type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
739 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
740
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
741 NSDictionary fileAttributesToWriteToFile (NSString fullDocumentPath, NSString documentTypeName, uint saveOperationType)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
742 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
743 return invokeObjcSelf!(NSDictionary, "fileAttributesToWriteToFile:ofType:saveOperation:", NSString, NSString, uint)(fullDocumentPath, documentTypeName, saveOperationType);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
744 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
745
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
746 NSString fileName ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
747 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
748 return invokeObjcSelf!(NSString, "fileName");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
749 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
750
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
751 NSFileWrapper fileWrapperRepresentationOfType (NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
752 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
753 return invokeObjcSelf!(NSFileWrapper, "fileWrapperRepresentationOfType:", NSString)(type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
754 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
755
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
756 typeof(this) initWithContentsOfFile (NSString absolutePath, NSString typeName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
757 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
758 id result = invokeObjcSelf!(id, "initWithContentsOfFile:ofType:", NSString, NSString)(absolutePath, typeName);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
759 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
760 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
761
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
762 this (NSString absolutePath, NSString typeName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
763 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
764 super(typeof(this).alloc.initWithContentsOfFile(absolutePath, typeName).objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
765 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
766
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
767 typeof(this) initWithContentsOfURL (NSURL absoluteURL, NSString typeName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
768 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
769 id result = invokeObjcSelf!(id, "initWithContentsOfURL:ofType:", NSURL, NSString)(absoluteURL, typeName);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
770 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
771 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
772
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
773 this (NSURL absoluteURL, NSString typeName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
774 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
775 super(typeof(this).alloc.initWithContentsOfURL(absoluteURL, typeName).objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
776 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
777
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
778 bool loadDataRepresentation (NSData data, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
779 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
780 return invokeObjcSelf!(bool, "loadDataRepresentation:ofType:", NSData, NSString)(data, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
781 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
782
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
783 bool loadFileWrapperRepresentation (NSFileWrapper wrapper, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
784 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
785 return invokeObjcSelf!(bool, "loadFileWrapperRepresentation:ofType:", NSFileWrapper, NSString)(wrapper, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
786 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
787
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
788 void printShowingPrintPanel (bool flag)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
789 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
790 return invokeObjcSelf!(void, "printShowingPrintPanel:", bool)(flag);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
791 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
792
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
793 bool readFromFile (NSString fileName, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
794 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
795 return invokeObjcSelf!(bool, "readFromFile:ofType:", NSString, NSString)(fileName, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
796 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
797
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
798 bool readFromURL (NSURL url, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
799 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
800 return invokeObjcSelf!(bool, "readFromURL:ofType:", NSURL, NSString)(url, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
801 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
802
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
803 bool revertToSavedFromFile (NSString fileName, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
804 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
805 return invokeObjcSelf!(bool, "revertToSavedFromFile:ofType:", NSString, NSString)(fileName, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
806 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
807
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
808 bool revertToSavedFromURL (NSURL url, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
809 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
810 return invokeObjcSelf!(bool, "revertToSavedFromURL:ofType:", NSURL, NSString)(url, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
811 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
812
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
813 NSInteger runModalPageLayoutWithPrintInfo (NSPrintInfo printInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
814 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
815 return invokeObjcSelf!(NSInteger, "runModalPageLayoutWithPrintInfo:", NSPrintInfo)(printInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
816 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
817
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
818 void saveToFile (NSString fileName, uint saveOperation, Object delegate_, SEL didSaveSelector, void* contextInfo)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
819 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
820 return invokeObjcSelf!(void, "saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:", NSString, uint, Object, SEL, void*)(fileName, saveOperation, delegate_, didSaveSelector, contextInfo);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
821 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
822
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
823 void setFileName (NSString fileName)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
824 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
825 return invokeObjcSelf!(void, "setFileName:", NSString)(fileName);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
826 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
827
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
828 bool writeToFile (NSString fileName, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
829 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
830 return invokeObjcSelf!(bool, "writeToFile:ofType:", NSString, NSString)(fileName, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
831 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
832
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
833 bool writeToFile (NSString fullDocumentPath, NSString documentTypeName, NSString fullOriginalDocumentPath, uint saveOperationType)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
834 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
835 return invokeObjcSelf!(bool, "writeToFile:ofType:originalFile:saveOperation:", NSString, NSString, NSString, uint)(fullDocumentPath, documentTypeName, fullOriginalDocumentPath, saveOperationType);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
836 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
837
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
838 bool writeToURL (NSURL url, NSString type)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
839 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
840 return invokeObjcSelf!(bool, "writeToURL:ofType:", NSURL, NSString)(url, type);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
841 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
842
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
843 bool writeWithBackupToFile (NSString fullDocumentPath, NSString documentTypeName, uint saveOperationType)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
844 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
845 return invokeObjcSelf!(bool, "writeWithBackupToFile:ofType:saveOperation:", NSString, NSString, uint)(fullDocumentPath, documentTypeName, saveOperationType);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
846 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
847
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
848 // NSScripting
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
849 NSString lastComponentOfFileName ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
850 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
851 return invokeObjcSelf!(NSString, "lastComponentOfFileName");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
852 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
853
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
854 void setLastComponentOfFileName (NSString str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
855 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
856 return invokeObjcSelf!(void, "setLastComponentOfFileName:", NSString)(str);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
857 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
858
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
859 Object handleSaveScriptCommand (NSScriptCommand command)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
860 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
861 return invokeObjcSelf!(Object, "handleSaveScriptCommand:", NSScriptCommand)(command);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
862 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
863
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
864 Object handleCloseScriptCommand (NSCloseCommand command)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
865 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
866 return invokeObjcSelf!(Object, "handleCloseScriptCommand:", NSCloseCommand)(command);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
867 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
868
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
869 Object handlePrintScriptCommand (NSScriptCommand command)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
870 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
871 return invokeObjcSelf!(Object, "handlePrintScriptCommand:", NSScriptCommand)(command);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
872 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
873
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
874 NSScriptObjectSpecifier objectSpecifier ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
875 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
876 return invokeObjcSelf!(NSScriptObjectSpecifier, "objectSpecifier");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
877 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff changeset
878 }