diff dwt/internal/cocoa/NSArray.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/NSArray.d	Sat Aug 09 17:00:02 2008 +0200
+++ b/dwt/internal/cocoa/NSArray.d	Tue Aug 19 17:35:17 2008 +0200
@@ -41,15 +41,15 @@
 
     public void addObserver_forKeyPath_options_context_ (NSObject observer, NSString keyPath, objc.id options, objc.id context)
     {
-        OS.objc_msgSend(this.id, OS.sel_addObserver_1forKeyPath_1options_1context_1, observer !is null ? observer.id : null,
-                keyPath !is null ? keyPath.id : null, options, context);
+        OS.objc_msgSend(this.id_, OS.sel_addObserver_1forKeyPath_1options_1context_1, observer !is null ? observer.id_ : null,
+                keyPath !is null ? keyPath.id_ : null, options, context);
     }
 
     public void addObserver_toObjectsAtIndexes_forKeyPath_options_context_ (NSObject observer, NSIndexSet indexes, NSString keyPath, objc.id options,
             objc.id context)
     {
-        OS.objc_msgSend(this.id, OS.sel_addObserver_1toObjectsAtIndexes_1forKeyPath_1options_1context_1, observer !is null ? observer.id : null,
-                indexes !is null ? indexes.id : null, keyPath !is null ? keyPath.id : null, options, context);
+        OS.objc_msgSend(this.id_, OS.sel_addObserver_1toObjectsAtIndexes_1forKeyPath_1options_1context_1, observer !is null ? observer.id_ : null,
+                indexes !is null ? indexes.id_ : null, keyPath !is null ? keyPath.id_ : null, options, context);
     }
 
     public static id array ()
@@ -60,43 +60,43 @@
 
     public NSArray arrayByAddingObject (id anObject)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_arrayByAddingObject_1, anObject !is null ? anObject.id : null);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_arrayByAddingObject_1, anObject !is null ? anObject.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public NSArray arrayByAddingObjectsFromArray (NSArray otherArray)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_arrayByAddingObjectsFromArray_1, otherArray !is null ? otherArray.id : null);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_arrayByAddingObjectsFromArray_1, otherArray !is null ? otherArray.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public static id arrayWithArray (NSArray array)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithArray_1, array !is null ? array.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithArray_1, array !is null ? array.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public static id arrayWithContentsOfFile (NSString path)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithContentsOfFile_1, path !is null ? path.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithContentsOfFile_1, path !is null ? path.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public static id arrayWithContentsOfURL (NSURL url)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithContentsOfURL_1, url !is null ? url.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithContentsOfURL_1, url !is null ? url.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public static id arrayWithObject (id anObject)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithObject_1, anObject !is null ? anObject.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithObject_1, anObject !is null ? anObject.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public static id static_arrayWithObjects_ (id arrayWithObjects)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithObjects_1, arrayWithObjects !is null ? arrayWithObjects.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithObjects_1, arrayWithObjects !is null ? arrayWithObjects.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
@@ -108,235 +108,235 @@
 
     public NSString componentsJoinedByString (NSString separator)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_componentsJoinedByString_1, separator !is null ? separator.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_componentsJoinedByString_1, separator !is null ? separator.id_ : null);
         return result !is null ? new NSString(result) : null;
     }
 
     public bool containsObject (id anObject)
     {
-        return OS.objc_msgSend(this.id, OS.sel_containsObject_1, anObject !is null ? anObject.id : null) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_containsObject_1, anObject !is null ? anObject.id_ : null) !is null;
     }
 
     public NSUInteger count ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_count);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_count);
     }
 
     public NSString description ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_description);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_description);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSString descriptionWithLocale_ (id locale)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale !is null ? locale.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_descriptionWithLocale_1, locale !is null ? locale.id_ : null);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSString descriptionWithLocale_indent_ (id locale, objc.id level)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1indent_1, locale !is null ? locale.id : null, level);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_descriptionWithLocale_1indent_1, locale !is null ? locale.id_ : null, level);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSArray filteredArrayUsingPredicate (NSPredicate predicate)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_filteredArrayUsingPredicate_1, predicate !is null ? predicate.id : null);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_filteredArrayUsingPredicate_1, predicate !is null ? predicate.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public id firstObjectCommonWithArray (NSArray otherArray)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_firstObjectCommonWithArray_1, otherArray !is null ? otherArray.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_firstObjectCommonWithArray_1, otherArray !is null ? otherArray.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public void getObjects_ (objc.id objects)
     {
-        OS.objc_msgSend(this.id, OS.sel_getObjects_1, objects);
+        OS.objc_msgSend(this.id_, OS.sel_getObjects_1, objects);
     }
 
     public void getObjects_range_ (objc.id objects, NSRange range)
     {
-        OS.objc_msgSend(this.id, OS.sel_getObjects_1range_1, objects, range);
+        OS.objc_msgSend(this.id_, OS.sel_getObjects_1range_1, objects, range);
     }
 
     public NSUInteger indexOfObject_ (id anObject)
     {
-        return OS.objc_msgSend(this.id, OS.sel_indexOfObject_1, anObject !is null ? anObject.id : null);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_indexOfObject_1, anObject !is null ? anObject.id_ : null);
     }
 
     public NSUInteger indexOfObject_inRange_ (id anObject, NSRange range)
     {
-        return OS.objc_msgSend(this.id, OS.sel_indexOfObject_1inRange_1, anObject !is null ? anObject.id : null, range);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_indexOfObject_1inRange_1, anObject !is null ? anObject.id_ : null, range);
     }
 
     public NSUInteger indexOfObjectIdenticalTo_ (id anObject)
     {
-        return OS.objc_msgSend(this.id, OS.sel_indexOfObjectIdenticalTo_1, anObject !is null ? anObject.id : null);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_indexOfObjectIdenticalTo_1, anObject !is null ? anObject.id_ : null);
     }
 
     public NSUInteger indexOfObjectIdenticalTo_inRange_ (id anObject, NSRange range)
     {
-        return OS.objc_msgSend(this.id, OS.sel_indexOfObjectIdenticalTo_1inRange_1, anObject !is null ? anObject.id : null, range);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_indexOfObjectIdenticalTo_1inRange_1, anObject !is null ? anObject.id_ : null, range);
     }
 
     public NSArray initWithArray_ (NSArray array)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithArray_1, array !is null ? array.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithArray_1, array !is null ? array.id_ : null);
         return result !is null ? this : null;
     }
 
     public NSArray initWithArray_copyItems_ (NSArray array, bool flag)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithArray_1copyItems_1, array !is null ? array.id : null, flag);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithArray_1copyItems_1, array !is null ? array.id_ : null, flag);
         return result !is null ? this : null;
     }
 
     public NSArray initWithContentsOfFile (NSString path)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1, path !is null ? path.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfFile_1, path !is null ? path.id_ : null);
         return result !is null ? this : null;
     }
 
     public NSArray initWithContentsOfURL (NSURL url)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, url !is null ? url.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfURL_1, url !is null ? url.id_ : null);
         return result !is null ? this : null;
     }
 
     public NSArray initWithObjects_ (id initWithObjects)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1, initWithObjects !is null ? initWithObjects.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithObjects_1, initWithObjects !is null ? initWithObjects.id_ : null);
         return result !is null ? this : null;
     }
 
     public NSArray initWithObjects_count_ (/*const*/objc.id* objects, NSUInteger cnt)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1count_1, objects, cnt);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithObjects_1count_1, objects, cnt);
         return result !is null ? this : null;
     }
 
     public bool isEqualToArray (NSArray otherArray)
     {
-        return OS.objc_msgSend(this.id, OS.sel_isEqualToArray_1, otherArray !is null ? otherArray.id : null) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_isEqualToArray_1, otherArray !is null ? otherArray.id_ : null) !is null;
     }
 
     public id lastObject ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_lastObject);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_lastObject);
         return result !is null ? new id(result) : null;
     }
 
     public void makeObjectsPerformSelector_ (objc.SEL aSelector)
     {
-        OS.objc_msgSend(this.id, OS.sel_makeObjectsPerformSelector_1, aSelector);
+        OS.objc_msgSend(this.id_, OS.sel_makeObjectsPerformSelector_1, aSelector);
     }
 
     public void makeObjectsPerformSelector_withObject_ (objc.SEL aSelector, id argument)
     {
-        OS.objc_msgSend(this.id, OS.sel_makeObjectsPerformSelector_1withObject_1, aSelector, argument !is null ? argument.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_makeObjectsPerformSelector_1withObject_1, aSelector, argument !is null ? argument.id_ : null);
     }
 
     public objc.id objectAtIndex (NSUInteger index)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_objectAtIndex_1, index);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectAtIndex_1, index);
         return result;
     //  return result !is null ? new id(result) : null;
     }
 
     public NSEnumerator objectEnumerator ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_objectEnumerator);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectEnumerator);
         return result !is null ? new NSEnumerator(result) : null;
     }
 
     public NSArray objectsAtIndexes (NSIndexSet indexes)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_objectsAtIndexes_1, indexes !is null ? indexes.id : null);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectsAtIndexes_1, indexes !is null ? indexes.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public NSArray pathsMatchingExtensions (NSArray filterTypes)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_pathsMatchingExtensions_1, filterTypes !is null ? filterTypes.id : null);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_pathsMatchingExtensions_1, filterTypes !is null ? filterTypes.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public void removeObserver_forKeyPath_ (NSObject observer, NSString keyPath)
     {
-        OS.objc_msgSend(this.id, OS.sel_removeObserver_1forKeyPath_1, observer !is null ? observer.id : null, keyPath !is null ? keyPath.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_removeObserver_1forKeyPath_1, observer !is null ? observer.id_ : null, keyPath !is null ? keyPath.id_ : null);
     }
 
     public void removeObserver_fromObjectsAtIndexes_forKeyPath_ (NSObject observer, NSIndexSet indexes, NSString keyPath)
     {
-        OS.objc_msgSend(this.id, OS.sel_removeObserver_1fromObjectsAtIndexes_1forKeyPath_1, observer !is null ? observer.id : null,
-                indexes !is null ? indexes.id : null, keyPath !is null ? keyPath.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_removeObserver_1fromObjectsAtIndexes_1forKeyPath_1, observer !is null ? observer.id_ : null,
+                indexes !is null ? indexes.id_ : null, keyPath !is null ? keyPath.id_ : null);
     }
 
     public NSEnumerator reverseObjectEnumerator ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_reverseObjectEnumerator);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_reverseObjectEnumerator);
         return result !is null ? new NSEnumerator(result) : null;
     }
 
     public void setValue (id value, NSString key)
     {
-        OS.objc_msgSend(this.id, OS.sel_setValue_1forKey_1, value !is null ? value.id : null, key !is null ? key.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_setValue_1forKey_1, value !is null ? value.id_ : null, key !is null ? key.id_ : null);
     }
 
     public NSData sortedArrayHint ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_sortedArrayHint);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_sortedArrayHint);
         return result !is null ? new NSData(result) : null;
     }
 
     public NSArray sortedArrayUsingDescriptors (NSArray sortDescriptors)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_sortedArrayUsingDescriptors_1, sortDescriptors !is null ? sortDescriptors.id : null);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_sortedArrayUsingDescriptors_1, sortDescriptors !is null ? sortDescriptors.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public NSArray sortedArrayUsingFunction_context_ (objc.id comparator, objc.id context)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_sortedArrayUsingFunction_1context_1, comparator, context);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_sortedArrayUsingFunction_1context_1, comparator, context);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public NSArray sortedArrayUsingFunction_context_hint_ (objc.id comparator, objc.id context, NSData hint)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_sortedArrayUsingFunction_1context_1hint_1, comparator, context,
-                hint !is null ? hint.id : null);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_sortedArrayUsingFunction_1context_1hint_1, comparator, context,
+                hint !is null ? hint.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public NSArray sortedArrayUsingSelector (objc.id comparator)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_sortedArrayUsingSelector_1, comparator);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_sortedArrayUsingSelector_1, comparator);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public NSArray subarrayWithRange (NSRange range)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_subarrayWithRange_1, range);
-        return result is this.id ? this : (result !is null ? new NSArray(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_subarrayWithRange_1, range);
+        return result is this.id_ ? this : (result !is null ? new NSArray(result) : null);
     }
 
     public id valueForKey (NSString key)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_valueForKey_1, key !is null ? key.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_valueForKey_1, key !is null ? key.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public bool writeToFile (NSString path, bool useAuxiliaryFile)
     {
-        return OS.objc_msgSend(this.id, OS.sel_writeToFile_1atomically_1, path !is null ? path.id : null, useAuxiliaryFile) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_writeToFile_1atomically_1, path !is null ? path.id_ : null, useAuxiliaryFile) !is null;
     }
 
     public bool writeToURL (NSURL url, bool atomically)
     {
-        return OS.objc_msgSend(this.id, OS.sel_writeToURL_1atomically_1, url !is null ? url.id : null, atomically) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_writeToURL_1atomically_1, url !is null ? url.id_ : null, atomically) !is null;
     }
 
 }