Mercurial > projects > dstep
diff dstep/corefoundation/CFArray.d @ 11:07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sat, 01 Aug 2009 15:03:28 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dstep/corefoundation/CFArray.d Sat Aug 01 15:03:28 2009 +0200 @@ -0,0 +1,68 @@ +/** + * Copyright: Copyright (c) 2009 Jacob Carlborg. + * Authors: Jacob Carlborg + * Version: Initial created: Jul 12, 2009 + * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) + */ +module dstep.corefoundation.CFArray; + +import dstep.corefoundation.CFBase; +import dstep.objc.bridge.Bridge; +import dstep.objc.objc : id; + +struct __CFArray; +alias __CFArray* CFArrayRef; +alias __CFArray* CFMutableArrayRef; + +extern (C) +{ + alias void function (void*, void*) CFArrayApplierFunction; + alias ubyte function (void*, void*) CFArrayEqualCallBack; + alias CFStringRef function (void*) CFArrayCopyDescriptionCallBack; + alias void function (CFAllocatorRef, void*) CFArrayReleaseCallBack; + alias void* function (CFAllocatorRef, void*) CFArrayRetainCallBack; +} + +extern (C) +{ + extern + { + const CFArrayCallBacks kCFTypeArrayCallBacks; + } +} + +struct CFArrayCallBacks +{ + int version_; + CFArrayRetainCallBack* retain; + CFArrayReleaseCallBack* release; + CFArrayCopyDescriptionCallBack* copyDescription; + CFArrayEqualCallBack* equal; +} + +extern (C) +{ + uint CFArrayGetTypeID (); + CFArrayRef CFArrayCreate (CFAllocatorRef allocator, void** values, int numValues, CFArrayCallBacks* callBacks); + CFArrayRef CFArrayCreateCopy (CFAllocatorRef allocator, CFArrayRef theArray); + CFMutableArrayRef CFArrayCreateMutable (CFAllocatorRef allocator, int capacity, CFArrayCallBacks* callBacks); + CFMutableArrayRef CFArrayCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFArrayRef theArray); + int CFArrayGetCount (CFArrayRef theArray); + int CFArrayGetCountOfValue (CFArrayRef theArray, CFRange range, void* value); + ubyte CFArrayContainsValue (CFArrayRef theArray, CFRange range, void* value); + void* CFArrayGetValueAtIndex (CFArrayRef theArray, int idx); + void CFArrayGetValues (CFArrayRef theArray, CFRange range, void** values); + void CFArrayApplyFunction (CFArrayRef theArray, CFRange range, CFArrayApplierFunction* applier, void* context); + int CFArrayGetFirstIndexOfValue (CFArrayRef theArray, CFRange range, void* value); + int CFArrayGetLastIndexOfValue (CFArrayRef theArray, CFRange range, void* value); + int CFArrayBSearchValues (CFArrayRef theArray, CFRange range, void* value, CFComparatorFunction* comparator, void* context); + void CFArrayAppendValue (CFMutableArrayRef theArray, void* value); + void CFArrayInsertValueAtIndex (CFMutableArrayRef theArray, int idx, void* value); + void CFArraySetValueAtIndex (CFMutableArrayRef theArray, int idx, void* value); + void CFArrayRemoveValueAtIndex (CFMutableArrayRef theArray, int idx); + void CFArrayRemoveAllValues (CFMutableArrayRef theArray); + void CFArrayReplaceValues (CFMutableArrayRef theArray, CFRange range, void** newValues, int newCount); + void CFArrayExchangeValuesAtIndices (CFMutableArrayRef theArray, int idx1, int idx2); + void CFArraySortValues (CFMutableArrayRef theArray, CFRange range, CFComparatorFunction* comparator, void* context); + void CFArrayAppendArray (CFMutableArrayRef theArray, CFArrayRef otherArray, CFRange otherRange); +} \ No newline at end of file