Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSCoder.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/NSCoder.d Sat Aug 09 17:00:02 2008 +0200 +++ b/dwt/internal/cocoa/NSCoder.d Tue Aug 19 17:35:17 2008 +0200 @@ -21,6 +21,7 @@ import dwt.internal.cocoa.NSRect; import dwt.internal.cocoa.NSSize; import dwt.internal.cocoa.NSString; +import dwt.internal.cocoa.NSZone; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; @@ -38,303 +39,303 @@ public bool allowsKeyedCoding () { - return OS.objc_msgSend(this.id, OS.sel_allowsKeyedCoding) !is null; + return OS.objc_msgSend(this.id_, OS.sel_allowsKeyedCoding) !is null; } public bool containsValueForKey (NSString key) { - return OS.objc_msgSend(this.id, OS.sel_containsValueForKey_1, key !is null ? key.id : null) !is null; + return OS.objc_msgSend(this.id_, OS.sel_containsValueForKey_1, key !is null ? key.id_ : null) !is null; } public void decodeArrayOfObjCType (/*const*/char* itemType, NSUInteger count, void* array) { - OS.objc_msgSend(this.id, OS.sel_decodeArrayOfObjCType_1count_1at_1, itemType, count, array); + OS.objc_msgSend(this.id_, OS.sel_decodeArrayOfObjCType_1count_1at_1, itemType, count, array); } public bool decodeBoolForKey (NSString key) { - return OS.objc_msgSend(this.id, OS.sel_decodeBoolForKey_1, key !is null ? key.id : null) !is null; + return OS.objc_msgSend(this.id_, OS.sel_decodeBoolForKey_1, key !is null ? key.id_ : null) !is null; } - public byte* decodeBytesForKey (NSString key, NSUInteger lengthp) + public /*const*/ubyte* decodeBytesForKey (NSString key, NSUInteger* lengthp) { - return OS.objc_msgSend(this.id, OS.sel_decodeBytesForKey_1returnedLength_1, key !is null ? key.id : null, lengthp); + return cast(/*const*/ubyte*) OS.objc_msgSend(this.id_, OS.sel_decodeBytesForKey_1returnedLength_1, key !is null ? key.id_ : null, lengthp); } - public void* decodeBytesWithReturnedLength (NSUInteger lengthp) + public void* decodeBytesWithReturnedLength (NSUInteger* lengthp) { - return OS.objc_msgSend(this.id, OS.sel_decodeBytesWithReturnedLength_1, lengthp); + return cast(void*) OS.objc_msgSend(this.id_, OS.sel_decodeBytesWithReturnedLength_1, lengthp); } public NSData decodeDataObject () { - objc.id result = OS.objc_msgSend(this.id, OS.sel_decodeDataObject); + objc.id result = OS.objc_msgSend(this.id_, OS.sel_decodeDataObject); return result !is null ? new NSData(result) : null; } public double decodeDoubleForKey (NSString key) { - return OS.objc_msgSend_fpret(this.id, OS.sel_decodeDoubleForKey_1, key !is null ? key.id : null); + return OS.objc_msgSend_fpret(this.id_, OS.sel_decodeDoubleForKey_1, key !is null ? key.id_ : null); } public float decodeFloatForKey (NSString key) { - return cast(float) OS.objc_msgSend_fpret(this.id, OS.sel_decodeFloatForKey_1, key !is null ? key.id : null); + return cast(float) OS.objc_msgSend_fpret(this.id_, OS.sel_decodeFloatForKey_1, key !is null ? key.id_ : null); } public int decodeInt32ForKey (NSString key) { - return OS.objc_msgSend(this.id, OS.sel_decodeInt32ForKey_1, key !is null ? key.id : null); + return cast(int) OS.objc_msgSend(this.id_, OS.sel_decodeInt32ForKey_1, key !is null ? key.id_ : null); } public long decodeInt64ForKey (NSString key) { - return cast(long) OS.objc_msgSend(this.id, OS.sel_decodeInt64ForKey_1, key !is null ? key.id : null); + return cast(long) OS.objc_msgSend(this.id_, OS.sel_decodeInt64ForKey_1, key !is null ? key.id_ : null); } public int decodeIntForKey (NSString key) { - return OS.objc_msgSend(this.id, OS.sel_decodeIntForKey_1, key !is null ? key.id : null); + return cast(int) OS.objc_msgSend(this.id_, OS.sel_decodeIntForKey_1, key !is null ? key.id_ : null); } - public int decodeIntegerForKey (NSString key) + public NSInteger decodeIntegerForKey (NSString key) { - return OS.objc_msgSend(this.id, OS.sel_decodeIntegerForKey_1, key !is null ? key.id : null); + return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_decodeIntegerForKey_1, key !is null ? key.id_ : null); } public id decodeNXObject () { - objc.id result = OS.objc_msgSend(this.id, OS.sel_decodeNXObject); + objc.id result = OS.objc_msgSend(this.id_, OS.sel_decodeNXObject); return result !is null ? new id(result) : null; } public id decodeObject () { - objc.id result = OS.objc_msgSend(this.id, OS.sel_decodeObject); + objc.id result = OS.objc_msgSend(this.id_, OS.sel_decodeObject); return result !is null ? new id(result) : null; } public id decodeObjectForKey (NSString key) { - objc.id result = OS.objc_msgSend(this.id, OS.sel_decodeObjectForKey_1, key !is null ? key.id : null); + objc.id result = OS.objc_msgSend(this.id_, OS.sel_decodeObjectForKey_1, key !is null ? key.id_ : null); return result !is null ? new id(result) : null; } public NSPoint decodePoint () { NSPoint result; - OS.objc_msgSend_stret(result, this.id, OS.sel_decodePoint); + OS.objc_msgSend_stret(&result, this.id_, OS.sel_decodePoint); return result; } public NSPoint decodePointForKey (NSString key) { NSPoint result; - OS.objc_msgSend_stret(result, this.id, OS.sel_decodePointForKey_1, key !is null ? key.id : null); + OS.objc_msgSend_stret(&result, this.id_, OS.sel_decodePointForKey_1, key !is null ? key.id_ : null); return result; } public id decodePropertyList () { - objc.id result = OS.objc_msgSend(this.id, OS.sel_decodePropertyList); + objc.id result = OS.objc_msgSend(this.id_, OS.sel_decodePropertyList); return result !is null ? new id(result) : null; } public NSRect decodeRect () { NSRect result; - OS.objc_msgSend_stret(result, this.id, OS.sel_decodeRect); + OS.objc_msgSend_stret(&result, this.id_, OS.sel_decodeRect); return result; } public NSRect decodeRectForKey (NSString key) { NSRect result; - OS.objc_msgSend_stret(result, this.id, OS.sel_decodeRectForKey_1, key !is null ? key.id : null); + OS.objc_msgSend_stret(&result, this.id_, OS.sel_decodeRectForKey_1, key !is null ? key.id_ : null); return result; } public NSSize decodeSize () { NSSize result; - OS.objc_msgSend_stret(result, this.id, OS.sel_decodeSize); + OS.objc_msgSend_stret(&result, this.id_, OS.sel_decodeSize); return result; } public NSSize decodeSizeForKey (NSString key) { NSSize result; - OS.objc_msgSend_stret(result, this.id, OS.sel_decodeSizeForKey_1, key !is null ? key.id : null); + OS.objc_msgSend_stret(&result, this.id_, OS.sel_decodeSizeForKey_1, key !is null ? key.id_ : null); return result; } public void decodeValueOfObjCType (/*const*/char* type, void* data) { - OS.objc_msgSend(this.id, OS.sel_decodeValueOfObjCType_1at_1, type, data); + OS.objc_msgSend(this.id_, OS.sel_decodeValueOfObjCType_1at_1, type, data); } public void decodeValuesOfObjCTypes (/*const*/char* decodeValuesOfObjCTypes) { - OS.objc_msgSend(this.id, OS.sel_decodeValuesOfObjCTypes_1, decodeValuesOfObjCTypes); + OS.objc_msgSend(this.id_, OS.sel_decodeValuesOfObjCTypes_1, decodeValuesOfObjCTypes); } public void encodeArrayOfObjCType (/*const*/char* type, NSUInteger count, void* array) { - OS.objc_msgSend(this.id, OS.sel_encodeArrayOfObjCType_1count_1at_1, type, count, array); + OS.objc_msgSend(this.id_, OS.sel_encodeArrayOfObjCType_1count_1at_1, type, count, array); } public void encodeBool (bool boolv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeBool_1forKey_1, boolv, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeBool_1forKey_1, boolv, key !is null ? key.id_ : null); } public void encodeBycopyObject (id anObject) { - OS.objc_msgSend(this.id, OS.sel_encodeBycopyObject_1, anObject !is null ? anObject.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeBycopyObject_1, anObject !is null ? anObject.id_ : null); } public void encodeByrefObject (id anObject) { - OS.objc_msgSend(this.id, OS.sel_encodeByrefObject_1, anObject !is null ? anObject.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeByrefObject_1, anObject !is null ? anObject.id_ : null); } - public void encodeBytes_length_ (void* byteaddr, NSUInteger length) + public void encodeBytes_length_ (/*const*/void* byteaddr, NSUInteger length) { - OS.objc_msgSend(this.id, OS.sel_encodeBytes_1length_1, byteaddr.ptr, length); + OS.objc_msgSend(this.id_, OS.sel_encodeBytes_1length_1, byteaddr, length); } public void encodeBytes_length_forKey_ (byte* bytesp, NSUInteger lenv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeBytes_1length_1forKey_1, bytesp, lenv, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeBytes_1length_1forKey_1, bytesp, lenv, key !is null ? key.id_ : null); } public void encodeConditionalObject_ (id object) { - OS.objc_msgSend(this.id, OS.sel_encodeConditionalObject_1, object !is null ? object.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeConditionalObject_1, object !is null ? object.id_ : null); } public void encodeConditionalObject_forKey_ (id objv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeConditionalObject_1forKey_1, objv !is null ? objv.id : null, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeConditionalObject_1forKey_1, objv !is null ? objv.id_ : null, key !is null ? key.id_ : null); } public void encodeDataObject (NSData data) { - OS.objc_msgSend(this.id, OS.sel_encodeDataObject_1, data !is null ? data.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeDataObject_1, data !is null ? data.id_ : null); } public void encodeDouble (double realv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeDouble_1forKey_1, realv, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeDouble_1forKey_1, realv, key !is null ? key.id_ : null); } public void encodeFloat (float realv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeFloat_1forKey_1, realv, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeFloat_1forKey_1, realv, key !is null ? key.id_ : null); } public void encodeInt32 (int intv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeInt32_1forKey_1, intv, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeInt32_1forKey_1, intv, key !is null ? key.id_ : null); } public void encodeInt64 (long intv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeInt64_1forKey_1, intv, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeInt64_1forKey_1, intv, key !is null ? key.id_ : null); } public void encodeInt (int intv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeInt_1forKey_1, intv, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeInt_1forKey_1, intv, key !is null ? key.id_ : null); } - public void encodeInteger (int intv, NSString key) + public void encodeInteger (NSInteger intv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeInteger_1forKey_1, intv, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeInteger_1forKey_1, intv, key !is null ? key.id_ : null); } public void encodeNXObject (id object) { - OS.objc_msgSend(this.id, OS.sel_encodeNXObject_1, object !is null ? object.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeNXObject_1, object !is null ? object.id_ : null); } public void encodeObject_ (id object) { - OS.objc_msgSend(this.id, OS.sel_encodeObject_1, object !is null ? object.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeObject_1, object !is null ? object.id_ : null); } public void encodeObject_forKey_ (id objv, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeObject_1forKey_1, objv !is null ? objv.id : null, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeObject_1forKey_1, objv !is null ? objv.id_ : null, key !is null ? key.id_ : null); } public void encodePoint_ (NSPoint point) { - OS.objc_msgSend(this.id, OS.sel_encodePoint_1, point); + OS.objc_msgSend(this.id_, OS.sel_encodePoint_1, point); } public void encodePoint_forKey_ (NSPoint point, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodePoint_1forKey_1, point, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodePoint_1forKey_1, point, key !is null ? key.id_ : null); } public void encodePropertyList (id aPropertyList) { - OS.objc_msgSend(this.id, OS.sel_encodePropertyList_1, aPropertyList !is null ? aPropertyList.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodePropertyList_1, aPropertyList !is null ? aPropertyList.id_ : null); } public void encodeRect_ (NSRect rect) { - OS.objc_msgSend(this.id, OS.sel_encodeRect_1, rect); + OS.objc_msgSend(this.id_, OS.sel_encodeRect_1, rect); } public void encodeRect_forKey_ (NSRect rect, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeRect_1forKey_1, rect, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeRect_1forKey_1, rect, key !is null ? key.id_ : null); } public void encodeRootObject (id rootObject) { - OS.objc_msgSend(this.id, OS.sel_encodeRootObject_1, rootObject !is null ? rootObject.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeRootObject_1, rootObject !is null ? rootObject.id_ : null); } public void encodeSize_ (NSSize size) { - OS.objc_msgSend(this.id, OS.sel_encodeSize_1, size); + OS.objc_msgSend(this.id_, OS.sel_encodeSize_1, size); } public void encodeSize_forKey_ (NSSize size, NSString key) { - OS.objc_msgSend(this.id, OS.sel_encodeSize_1forKey_1, size, key !is null ? key.id : null); + OS.objc_msgSend(this.id_, OS.sel_encodeSize_1forKey_1, size, key !is null ? key.id_ : null); } public void encodeValueOfObjCType (/*const*/char* type, void* addr) { - OS.objc_msgSend(this.id, OS.sel_encodeValueOfObjCType_1at_1, type, addr); + OS.objc_msgSend(this.id_, OS.sel_encodeValueOfObjCType_1at_1, type, addr); } public void encodeValuesOfObjCTypes (/*const*/char* encodeValuesOfObjCTypes) { - OS.objc_msgSend(this.id, OS.sel_encodeValuesOfObjCTypes_1, encodeValuesOfObjCTypes); + OS.objc_msgSend(this.id_, OS.sel_encodeValuesOfObjCTypes_1, encodeValuesOfObjCTypes); } - public objc.id objectZone () + public NSZone* objectZone () { - return OS.objc_msgSend(this.id, OS.sel_objectZone); + return cast(NSZone*) OS.objc_msgSend(this.id_, OS.sel_objectZone); } public void setObjectZone (objc.id zone) { - OS.objc_msgSend(this.id, OS.sel_setObjectZone_1, zone); + OS.objc_msgSend(this.id_, OS.sel_setObjectZone_1, zone); } public uint systemVersion () { - return OS.objc_msgSend(this.id, OS.sel_systemVersion); + return cast(uint) OS.objc_msgSend(this.id_, OS.sel_systemVersion); } public NSInteger versionForClassName (NSString className) { - return OS.objc_msgSend(this.id, OS.sel_versionForClassName_1, className !is null ? className.id : null); + return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_versionForClassName_1, className !is null ? className.id_ : null); } }