Mercurial > projects > dstep
diff dstep/corefoundation/CFSet.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/CFSet.d Sat Aug 01 15:03:28 2009 +0200 @@ -0,0 +1,66 @@ +/** + * 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.CFSet; + +import dstep.corefoundation.CFBase; +import dstep.objc.bridge.Bridge; +import dstep.objc.objc : id; +import bindings = dstep.corefoundation.CFSet_bindings; + +struct __CFSet; +alias __CFSet* CFSetRef; +alias __CFSet* CFMutableSetRef; + +extern (C) +{ + alias uint function (void*) CFSetHashCallBack; + alias CFStringRef function (void*) CFSetCopyDescriptionCallBack; + alias void function (CFAllocatorRef, void*) CFSetReleaseCallBack; + alias void* function (CFAllocatorRef, void*) CFSetRetainCallBack; + alias void function (void*, void*) CFSetApplierFunction; + alias ubyte function (void*, void*) CFSetEqualCallBack; +} + +extern (C) +{ + extern + { + const CFSetCallBacks kCFTypeSetCallBacks; + const CFSetCallBacks kCFCopyStringSetCallBacks; + } +} + +struct CFSetCallBacks +{ + int version_; + CFSetRetainCallBack* retain; + CFSetReleaseCallBack* release; + CFSetCopyDescriptionCallBack* copyDescription; + CFSetEqualCallBack* equal; + CFSetHashCallBack* hash; +} + +extern (C) +{ + uint CFSetGetTypeID (); + CFSetRef CFSetCreate (CFAllocatorRef allocator, void** values, int numValues, CFSetCallBacks* callBacks); + CFSetRef CFSetCreateCopy (CFAllocatorRef allocator, CFSetRef theSet); + CFMutableSetRef CFSetCreateMutable (CFAllocatorRef allocator, int capacity, CFSetCallBacks* callBacks); + CFMutableSetRef CFSetCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFSetRef theSet); + int CFSetGetCount (CFSetRef theSet); + int CFSetGetCountOfValue (CFSetRef theSet, void* value); + ubyte CFSetContainsValue (CFSetRef theSet, void* value); + void* CFSetGetValue (CFSetRef theSet, void* value); + ubyte CFSetGetValueIfPresent (CFSetRef theSet, void* candidate, void** value); + void CFSetGetValues (CFSetRef theSet, void** values); + void CFSetApplyFunction (CFSetRef theSet, CFSetApplierFunction* applier, void* context); + void CFSetAddValue (CFMutableSetRef theSet, void* value); + void CFSetReplaceValue (CFMutableSetRef theSet, void* value); + void CFSetSetValue (CFMutableSetRef theSet, void* value); + void CFSetRemoveValue (CFMutableSetRef theSet, void* value); + void CFSetRemoveAllValues (CFMutableSetRef theSet); +} \ No newline at end of file