Mercurial > projects > dstep
comparison dstep/corefoundation/CFDictionary.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 |
comparison
equal
deleted
inserted
replaced
10:27e00625790b | 11:07194b026fa4 |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Jul 12, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.corefoundation.CFDictionary; | |
8 | |
9 import dstep.corefoundation.CFBase; | |
10 import dstep.objc.bridge.Bridge; | |
11 import dstep.objc.objc : id; | |
12 | |
13 struct __CFDictionary; | |
14 alias __CFDictionary* CFDictionaryRef; | |
15 alias __CFDictionary* CFMutableDictionaryRef; | |
16 | |
17 extern (C) | |
18 { | |
19 alias ubyte function (void*, void*) CFDictionaryEqualCallBack; | |
20 alias uint function (void*) CFDictionaryHashCallBack; | |
21 alias void* function (CFAllocatorRef, void*) CFDictionaryRetainCallBack; | |
22 alias CFStringRef function (void*) CFDictionaryCopyDescriptionCallBack; | |
23 alias void function (CFAllocatorRef, void*) CFDictionaryReleaseCallBack; | |
24 alias void function (void*, void*, void*) CFDictionaryApplierFunction; | |
25 } | |
26 | |
27 extern (C) | |
28 { | |
29 extern | |
30 { | |
31 const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks; | |
32 const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks; | |
33 const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks; | |
34 } | |
35 } | |
36 | |
37 struct CFDictionaryKeyCallBacks | |
38 { | |
39 int version_; | |
40 CFDictionaryRetainCallBack* retain; | |
41 CFDictionaryReleaseCallBack* release; | |
42 CFDictionaryCopyDescriptionCallBack* copyDescription; | |
43 CFDictionaryEqualCallBack* equal; | |
44 CFDictionaryHashCallBack* hash; | |
45 } | |
46 | |
47 | |
48 struct CFDictionaryValueCallBacks | |
49 { | |
50 int version_; | |
51 CFDictionaryRetainCallBack* retain; | |
52 CFDictionaryReleaseCallBack* release; | |
53 CFDictionaryCopyDescriptionCallBack* copyDescription; | |
54 CFDictionaryEqualCallBack* equal; | |
55 } | |
56 | |
57 extern (C) | |
58 { | |
59 uint CFDictionaryGetTypeID (); | |
60 CFDictionaryRef CFDictionaryCreate (CFAllocatorRef allocator, void** keys, void** values, int numValues, CFDictionaryKeyCallBacks* keyCallBacks, CFDictionaryValueCallBacks* valueCallBacks); | |
61 CFDictionaryRef CFDictionaryCreateCopy (CFAllocatorRef allocator, CFDictionaryRef theDict); | |
62 CFMutableDictionaryRef CFDictionaryCreateMutable (CFAllocatorRef allocator, int capacity, CFDictionaryKeyCallBacks* keyCallBacks, CFDictionaryValueCallBacks* valueCallBacks); | |
63 CFMutableDictionaryRef CFDictionaryCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFDictionaryRef theDict); | |
64 int CFDictionaryGetCount (CFDictionaryRef theDict); | |
65 int CFDictionaryGetCountOfKey (CFDictionaryRef theDict, void* key); | |
66 int CFDictionaryGetCountOfValue (CFDictionaryRef theDict, void* value); | |
67 ubyte CFDictionaryContainsKey (CFDictionaryRef theDict, void* key); | |
68 ubyte CFDictionaryContainsValue (CFDictionaryRef theDict, void* value); | |
69 void* CFDictionaryGetValue (CFDictionaryRef theDict, void* key); | |
70 ubyte CFDictionaryGetValueIfPresent (CFDictionaryRef theDict, void* key, void** value); | |
71 void CFDictionaryGetKeysAndValues (CFDictionaryRef theDict, void** keys, void** values); | |
72 void CFDictionaryApplyFunction (CFDictionaryRef theDict, CFDictionaryApplierFunction* applier, void* context); | |
73 void CFDictionaryAddValue (CFMutableDictionaryRef theDict, void* key, void* value); | |
74 void CFDictionarySetValue (CFMutableDictionaryRef theDict, void* key, void* value); | |
75 void CFDictionaryReplaceValue (CFMutableDictionaryRef theDict, void* key, void* value); | |
76 void CFDictionaryRemoveValue (CFMutableDictionaryRef theDict, void* key); | |
77 void CFDictionaryRemoveAllValues (CFMutableDictionaryRef theDict); | |
78 } |