diff dwt/internal/cocoa/NSDocumentController.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSDocumentController.d	Sat Aug 09 17:00:02 2008 +0200
+++ b/dwt/internal/cocoa/NSDocumentController.d	Tue Aug 19 17:35:17 2008 +0200
@@ -41,259 +41,259 @@
 
     public NSArray URLsFromRunningOpenPanel ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_URLsFromRunningOpenPanel);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_URLsFromRunningOpenPanel);
         return result !is null ? new NSArray(result) : null;
     }
 
     public void addDocument (NSDocument document)
     {
-        OS.objc_msgSend(this.id, OS.sel_addDocument_1, document !is null ? document.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_addDocument_1, document !is null ? document.id_ : null);
     }
 
     public double autosavingDelay ()
     {
-        return OS.objc_msgSend_fpret(this.id, OS.sel_autosavingDelay);
+        return OS.objc_msgSend_fpret(this.id_, OS.sel_autosavingDelay);
     }
 
     public void clearRecentDocuments (id sender)
     {
-        OS.objc_msgSend(this.id, OS.sel_clearRecentDocuments_1, sender !is null ? sender.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_clearRecentDocuments_1, sender !is null ? sender.id_ : null);
     }
 
     public void closeAllDocumentsWithDelegate (id delegatee, objc.id didCloseAllSelector, void* contextInfo)
     {
-        OS.objc_msgSend(this.id, OS.sel_closeAllDocumentsWithDelegate_1didCloseAllSelector_1contextInfo_1, delegatee !is null ? delegatee.id : null,
+        OS.objc_msgSend(this.id_, OS.sel_closeAllDocumentsWithDelegate_1didCloseAllSelector_1contextInfo_1, delegatee !is null ? delegatee.id_ : null,
                 didCloseAllSelector, contextInfo);
     }
 
     public NSString currentDirectory ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_currentDirectory);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_currentDirectory);
         return result !is null ? new NSString(result) : null;
     }
 
     public id currentDocument ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_currentDocument);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_currentDocument);
         return result !is null ? new id(result) : null;
     }
 
     public NSString defaultType ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_defaultType);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_defaultType);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSString displayNameForType (NSString typeName)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_displayNameForType_1, typeName !is null ? typeName.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_displayNameForType_1, typeName !is null ? typeName.id_ : null);
         return result !is null ? new NSString(result) : null;
     }
 
-    public Class documentClassForType (NSString typeName)
+    public objc.Class documentClassForType (NSString typeName)
     {
-        return OS.objc_msgSend(this.id, OS.sel_documentClassForType_1, typeName !is null ? typeName.id : null);
+        return cast(objc.Class) OS.objc_msgSend(this.id_, OS.sel_documentClassForType_1, typeName !is null ? typeName.id_ : null);
     }
 
     public NSArray documentClassNames ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_documentClassNames);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_documentClassNames);
         return result !is null ? new NSArray(result) : null;
     }
 
     public id documentForFileName (NSString fileName)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_documentForFileName_1, fileName !is null ? fileName.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_documentForFileName_1, fileName !is null ? fileName.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public id documentForURL (NSURL absoluteURL)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_documentForURL_1, absoluteURL !is null ? absoluteURL.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_documentForURL_1, absoluteURL !is null ? absoluteURL.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public id documentForWindow (NSWindow window)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_documentForWindow_1, window !is null ? window.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_documentForWindow_1, window !is null ? window.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public NSArray documents ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_documents);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_documents);
         return result !is null ? new NSArray(result) : null;
     }
 
     public NSArray fileExtensionsFromType (NSString typeName)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_fileExtensionsFromType_1, typeName !is null ? typeName.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_fileExtensionsFromType_1, typeName !is null ? typeName.id_ : null);
         return result !is null ? new NSArray(result) : null;
     }
 
     public NSArray fileNamesFromRunningOpenPanel ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_fileNamesFromRunningOpenPanel);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_fileNamesFromRunningOpenPanel);
         return result !is null ? new NSArray(result) : null;
     }
 
     public bool hasEditedDocuments ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_hasEditedDocuments) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_hasEditedDocuments) !is null;
     }
 
     public id makeDocumentForURL (NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, NSString typeName, objc.id** outError)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_makeDocumentForURL_1withContentsOfURL_1ofType_1error_1,
-                absoluteDocumentURL !is null ? absoluteDocumentURL.id : null,
-                absoluteDocumentContentsURL !is null ? absoluteDocumentContentsURL.id : null, typeName !is null ? typeName.id : null, outError);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_makeDocumentForURL_1withContentsOfURL_1ofType_1error_1,
+                absoluteDocumentURL !is null ? absoluteDocumentURL.id_ : null,
+                absoluteDocumentContentsURL !is null ? absoluteDocumentContentsURL.id_ : null, typeName !is null ? typeName.id_ : null, outError);
         return result !is null ? new id(result) : null;
     }
 
     public id makeDocumentWithContentsOfFile (NSString fileName, NSString type)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_makeDocumentWithContentsOfFile_1ofType_1, fileName !is null ? fileName.id : null,
-                type !is null ? type.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_makeDocumentWithContentsOfFile_1ofType_1, fileName !is null ? fileName.id_ : null,
+                type !is null ? type.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public id makeDocumentWithContentsOfURL_ofType_ (NSURL url, NSString type)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_makeDocumentWithContentsOfURL_1ofType_1, url !is null ? url.id : null,
-                type !is null ? type.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_makeDocumentWithContentsOfURL_1ofType_1, url !is null ? url.id_ : null,
+                type !is null ? type.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public id makeDocumentWithContentsOfURL_ofType_error_ (NSURL absoluteURL, NSString typeName, objc.id** outError)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_makeDocumentWithContentsOfURL_1ofType_1error_1,
-                absoluteURL !is null ? absoluteURL.id : null, typeName !is null ? typeName.id : null, outError);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_makeDocumentWithContentsOfURL_1ofType_1error_1,
+                absoluteURL !is null ? absoluteURL.id_ : null, typeName !is null ? typeName.id_ : null, outError);
         return result !is null ? new id(result) : null;
     }
 
     public id makeUntitledDocumentOfType_ (NSString type)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_makeUntitledDocumentOfType_1, type !is null ? type.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_makeUntitledDocumentOfType_1, type !is null ? type.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public id makeUntitledDocumentOfType_error_ (NSString typeName, objc.id** outError)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_makeUntitledDocumentOfType_1error_1, typeName !is null ? typeName.id : null, outError);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_makeUntitledDocumentOfType_1error_1, typeName !is null ? typeName.id_ : null, outError);
         return result !is null ? new id(result) : null;
     }
 
     public NSUInteger maximumRecentDocumentCount ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_maximumRecentDocumentCount);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_maximumRecentDocumentCount);
     }
 
     public void newDocument (id sender)
     {
-        OS.objc_msgSend(this.id, OS.sel_newDocument_1, sender !is null ? sender.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_newDocument_1, sender !is null ? sender.id_ : null);
     }
 
     public void noteNewRecentDocument (NSDocument document)
     {
-        OS.objc_msgSend(this.id, OS.sel_noteNewRecentDocument_1, document !is null ? document.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_noteNewRecentDocument_1, document !is null ? document.id_ : null);
     }
 
     public void noteNewRecentDocumentURL (NSURL absoluteURL)
     {
-        OS.objc_msgSend(this.id, OS.sel_noteNewRecentDocumentURL_1, absoluteURL !is null ? absoluteURL.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_noteNewRecentDocumentURL_1, absoluteURL !is null ? absoluteURL.id_ : null);
     }
 
     public void openDocument (id sender)
     {
-        OS.objc_msgSend(this.id, OS.sel_openDocument_1, sender !is null ? sender.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_openDocument_1, sender !is null ? sender.id_ : null);
     }
 
     public id openDocumentWithContentsOfFile (NSString fileName, bool display)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_openDocumentWithContentsOfFile_1display_1, fileName !is null ? fileName.id : null, display);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_openDocumentWithContentsOfFile_1display_1, fileName !is null ? fileName.id_ : null, display);
         return result !is null ? new id(result) : null;
     }
 
     public id openDocumentWithContentsOfURL_display_ (NSURL url, bool display)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_openDocumentWithContentsOfURL_1display_1, url !is null ? url.id : null, display);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_openDocumentWithContentsOfURL_1display_1, url !is null ? url.id_ : null, display);
         return result !is null ? new id(result) : null;
     }
 
     public id openDocumentWithContentsOfURL_display_error_ (NSURL absoluteURL, bool displayDocument, objc.id** outError)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_openDocumentWithContentsOfURL_1display_1error_1,
-                absoluteURL !is null ? absoluteURL.id : null, displayDocument, outError);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_openDocumentWithContentsOfURL_1display_1error_1,
+                absoluteURL !is null ? absoluteURL.id_ : null, displayDocument, outError);
         return result !is null ? new id(result) : null;
     }
 
     public id openUntitledDocumentAndDisplay (bool displayDocument, objc.id** outError)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_openUntitledDocumentAndDisplay_1error_1, displayDocument, outError);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_openUntitledDocumentAndDisplay_1error_1, displayDocument, outError);
         return result !is null ? new id(result) : null;
     }
 
     public id openUntitledDocumentOfType (NSString type, bool display)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_openUntitledDocumentOfType_1display_1, type !is null ? type.id : null, display);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_openUntitledDocumentOfType_1display_1, type !is null ? type.id_ : null, display);
         return result !is null ? new id(result) : null;
     }
 
     public bool presentError_ (NSError error)
     {
-        return OS.objc_msgSend(this.id, OS.sel_presentError_1, error !is null ? error.id : null) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_presentError_1, error !is null ? error.id_ : null) !is null;
     }
 
-    public void presentError_modalForWindow_delegatee_didPresentSelector_contextInfo_ (NSError error, NSWindow window, id delegatee,
+    public void presentError_modalForWindow_delegate_didPresentSelector_contextInfo_ (NSError error, NSWindow window, id delegatee,
             objc.SEL didPresentSelector, void* contextInfo)
     {
-        OS.objc_msgSend(this.id, OS.sel_presentError_1modalForWindow_1delegatee_1didPresentSelector_1contextInfo_1, error !is null ? error.id : null,
-                window !is null ? window.id : null, delegatee !is null ? delegatee.id : null, didPresentSelector, contextInfo);
+        OS.objc_msgSend(this.id_, OS.sel_presentError_1modalForWindow_1delegate_1didPresentSelector_1contextInfo_1, error !is null ? error.id_ : null,
+                window !is null ? window.id_ : null, delegatee !is null ? delegatee.id_ : null, didPresentSelector, contextInfo);
     }
 
     public NSArray recentDocumentURLs ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_recentDocumentURLs);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_recentDocumentURLs);
         return result !is null ? new NSArray(result) : null;
     }
 
     public void removeDocument (NSDocument document)
     {
-        OS.objc_msgSend(this.id, OS.sel_removeDocument_1, document !is null ? document.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_removeDocument_1, document !is null ? document.id_ : null);
     }
 
     public bool reopenDocumentForURL (NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, objc.id** outError)
     {
-        return OS.objc_msgSend(this.id, OS.sel_reopenDocumentForURL_1withContentsOfURL_1error_1,
-                absoluteDocumentURL !is null ? absoluteDocumentURL.id : null,
-                absoluteDocumentContentsURL !is null ? absoluteDocumentContentsURL.id : null, outError) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_reopenDocumentForURL_1withContentsOfURL_1error_1,
+                absoluteDocumentURL !is null ? absoluteDocumentURL.id_ : null,
+                absoluteDocumentContentsURL !is null ? absoluteDocumentContentsURL.id_ : null, outError) !is null;
     }
 
     public void reviewUnsavedDocumentsWithAlertTitle (NSString title, bool cancellable, id delegatee, objc.SEL didReviewAllSelector, void* contextInfo)
     {
-        OS.objc_msgSend(this.id, OS.sel_reviewUnsavedDocumentsWithAlertTitle_1cancellable_1delegatee_1didReviewAllSelector_1contextInfo_1,
-                title !is null ? title.id : null, cancellable, delegatee !is null ? delegatee.id : null, didReviewAllSelector, contextInfo);
+        OS.objc_msgSend(this.id_, OS.sel_reviewUnsavedDocumentsWithAlertTitle_1cancellable_1delegate_1didReviewAllSelector_1contextInfo_1,
+                title !is null ? title.id_ : null, cancellable, delegatee !is null ? delegatee.id_ : null, didReviewAllSelector, contextInfo);
     }
 
     public NSInteger runModalOpenPanel (NSOpenPanel openPanel, NSArray types)
     {
-        return OS.objc_msgSend(this.id, OS.sel_runModalOpenPanel_1forTypes_1, openPanel !is null ? openPanel.id : null,
-                types !is null ? types.id : null);
+        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_runModalOpenPanel_1forTypes_1, openPanel !is null ? openPanel.id_ : null,
+                types !is null ? types.id_ : null);
     }
 
     public void saveAllDocuments (id sender)
     {
-        OS.objc_msgSend(this.id, OS.sel_saveAllDocuments_1, sender !is null ? sender.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_saveAllDocuments_1, sender !is null ? sender.id_ : null);
     }
 
     public void setAutosavingDelay (double autosavingDelay)
     {
-        OS.objc_msgSend(this.id, OS.sel_setAutosavingDelay_1, autosavingDelay);
+        OS.objc_msgSend(this.id_, OS.sel_setAutosavingDelay_1, autosavingDelay);
     }
 
     public void setShouldCreateUI (bool flag)
     {
-        OS.objc_msgSend(this.id, OS.sel_setShouldCreateUI_1, flag);
+        OS.objc_msgSend(this.id_, OS.sel_setShouldCreateUI_1, flag);
     }
 
     public static id sharedDocumentController ()
@@ -304,30 +304,30 @@
 
     public bool shouldCreateUI ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_shouldCreateUI) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_shouldCreateUI) !is null;
     }
 
     public NSString typeForContentsOfURL (NSURL inAbsoluteURL, objc.id** outError)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_typeForContentsOfURL_1error_1, inAbsoluteURL !is null ? inAbsoluteURL.id : null, outError);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_typeForContentsOfURL_1error_1, inAbsoluteURL !is null ? inAbsoluteURL.id_ : null, outError);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSString typeFromFileExtension (NSString fileNameExtensionOrHFSFileType)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_typeFromFileExtension_1,
-                fileNameExtensionOrHFSFileType !is null ? fileNameExtensionOrHFSFileType.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_typeFromFileExtension_1,
+                fileNameExtensionOrHFSFileType !is null ? fileNameExtensionOrHFSFileType.id_ : null);
         return result !is null ? new NSString(result) : null;
     }
 
     public bool validateUserInterfaceItem (id anItem)
     {
-        return OS.objc_msgSend(this.id, OS.sel_validateUserInterfaceItem_1, anItem !is null ? anItem.id : null) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_validateUserInterfaceItem_1, anItem !is null ? anItem.id_ : null) !is null;
     }
 
     public NSError willPresentError (NSError error)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_willPresentError_1, error !is null ? error.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_willPresentError_1, error !is null ? error.id_ : null);
         return result !is null ? new NSError(result) : null;
     }