Mercurial > projects > dstep
diff dstep/objc/runtime.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | 033d260cfc9b |
children | 420969b22201 |
line wrap: on
line diff
--- a/dstep/objc/runtime.d Mon Aug 03 15:31:48 2009 +0200 +++ b/dstep/objc/runtime.d Sun Jan 03 22:06:11 2010 +0100 @@ -15,10 +15,11 @@ import dstep.objc.message; import dstep.objc.objc; +struct objc_property; + alias objc_method* Method; alias objc_ivar* Ivar; alias objc_category* Category; -alias void* objc_property; alias objc_property* objc_property_t; alias objc_object Protocol; alias objc_symtab* Symtab; @@ -784,113 +785,4 @@ alias bindings.method_getSizeOfArguments method_getSizeOfArguments; alias bindings.class_respondsToMethod class_respondsToMethod; alias bindings.class_lookupMethod class_lookupMethod; -alias bindings.class_nextMethodList class_nextMethodList; - - - - - - - - -// D Extensions: - -struct objc -{ - static string[] copyImageNames (out uint outCount) - { - string[] ret; - - char** result = bindings.objc_copyImageNames(&outCount); - ret.length = outCount; - - for (size_t i = 0; i < outCount; i++) - ret[i] = fromStringz(result[i]); - - return ret; - } - - alias bindings.objc_enumerationMutation objc_enumerationMutation; - alias bindings.objc_setForwardHandler objc_setForwardHandler; - alias bindings.objc_setMultithreaded objc_setMultithreaded; - - static id getClass (string name) () - { - return bindings.objc_getClass(name.ptr); - } - - static id getMetaClass (string name) () - { - return bindings.objc_getMetaClass(name.ptr); - } - - static id lookUpClass (string name) () - { - return bindings.objc_lookUpClass(name.ptr); - } - - static id getRequiredClass (string name) () - { - return bindings.objc_getRequiredClass(name.ptr); - } - - static Class getFutureClass (string name) () - { - return bindings.objc_getFutureClass(name.ptr); - } - - static string[] objc_copyClassNamesForImage (string image) (out uint outCount) - { - string[] ret; - - char** result = bindings.objc_copyClassNamesForImage(image.ptr, &outCount); - ret.length = outCount; - - for (size_t i = 0; i < outCount; i++) - ret[i] = fromStringz(result[i]); - - return ret; - } - - static Class objc_getOrigClass (string name) () - { - return bindings.objc_getOrigClass(name.ptr); - } - - static Class allocateClassPair (string name) (Class superclass, size_t extraBytes) - { - return bindings.objc_allocateClassPair(superclass, name.ptr, extraBytes); - } - - alias bindings.objc_registerClassPair registerClassPair; - alias bindings.objc_disposeClassPair disposeClassPair; - alias bindings.objc_getClasses getClasses; - alias bindings.objc_addClass addClass; - alias bindings.class_createInstance createInstance; -} - -struct property -{ - static string property_getName (objc_property_t* property) - { - return fromStringz(bindings.property_getName(property)); - } - - static string property_getAttributes (objc_property_t* property) - { - return fromStringz(bindings.property_getAttributes(property)); - } -} - -struct sel -{ - static SEL getUid (string str) () - { - return bindings.sel_getUid(str.ptr); - } - - static SEL registerName (string str) () - { - return bindings.sel_registerName(str.ptr); - } -} \ No newline at end of file +alias bindings.class_nextMethodList class_nextMethodList; \ No newline at end of file