Mercurial > projects > dstep
comparison dstep/corefoundation/CFBase.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.CFBase; | |
8 | |
9 /*import dstep.AvailabilityMacros; | |
10 import dstep.MacTypes; | |
11 import dstep.coreservices.carboncore.MacTypes; | |
12 import dstep.libkern.OSTypes;*/ | |
13 import dstep.objc.bridge.Bridge; | |
14 import dstep.objc.objc : id; | |
15 /*import dstep.stdbool; | |
16 import dstep.stdint; | |
17 import dstep.windows; | |
18 import dstep.winsock2;*/ | |
19 | |
20 alias uint CFTypeID; | |
21 alias uint CFOptionFlags; | |
22 alias uint CFHashCode; | |
23 alias int CFIndex; | |
24 alias void* CFTypeRef; | |
25 struct __CFString; | |
26 alias __CFString* CFStringRef; | |
27 alias __CFString* CFMutableStringRef; | |
28 alias void* CFPropertyListRef; | |
29 alias int CFComparisonResult; | |
30 struct __CFNull; | |
31 alias __CFNull* CFNullRef; | |
32 struct __CFAllocator; | |
33 alias __CFAllocator* CFAllocatorRef; | |
34 | |
35 extern (C) | |
36 { | |
37 alias void function (void*, void*) CFAllocatorDeallocateCallBack; | |
38 alias void* function (void*, int, uint, void*) CFAllocatorReallocateCallBack; | |
39 alias void* function (void*) CFAllocatorRetainCallBack; | |
40 alias CFStringRef function (void*) CFAllocatorCopyDescriptionCallBack; | |
41 alias int function (void*, void*, void*) CFComparatorFunction; | |
42 alias void function (void*) CFAllocatorReleaseCallBack; | |
43 alias int function (int, uint, void*) CFAllocatorPreferredSizeCallBack; | |
44 alias void* function (int, uint, void*) CFAllocatorAllocateCallBack; | |
45 } | |
46 | |
47 extern (C) | |
48 { | |
49 extern | |
50 { | |
51 double kCFCoreFoundationVersionNumber; | |
52 const CFNullRef kCFNull; | |
53 const CFAllocatorRef kCFAllocatorDefault; | |
54 const CFAllocatorRef kCFAllocatorSystemDefault; | |
55 const CFAllocatorRef kCFAllocatorMalloc; | |
56 const CFAllocatorRef kCFAllocatorMallocZone; | |
57 const CFAllocatorRef kCFAllocatorNull; | |
58 const CFAllocatorRef kCFAllocatorUseContext; | |
59 } | |
60 } | |
61 | |
62 enum | |
63 { | |
64 kCFCompareLessThan = -1, | |
65 kCFCompareEqualTo = 0, | |
66 kCFCompareGreaterThan = 1 | |
67 } | |
68 | |
69 enum | |
70 { | |
71 kCFNotFound = -1 | |
72 } | |
73 | |
74 struct CFRange | |
75 { | |
76 int location; | |
77 int length; | |
78 } | |
79 | |
80 | |
81 struct CFAllocatorContext | |
82 { | |
83 int version_; | |
84 void* info; | |
85 CFAllocatorRetainCallBack* retain; | |
86 CFAllocatorReleaseCallBack* release; | |
87 CFAllocatorCopyDescriptionCallBack* copyDescription; | |
88 CFAllocatorAllocateCallBack* allocate; | |
89 CFAllocatorReallocateCallBack* reallocate; | |
90 CFAllocatorDeallocateCallBack* deallocate; | |
91 CFAllocatorPreferredSizeCallBack* preferredSize; | |
92 } | |
93 | |
94 extern (C) | |
95 { | |
96 CFRange __CFRangeMake (int loc, int len); | |
97 uint CFNullGetTypeID (); | |
98 uint CFAllocatorGetTypeID (); | |
99 void CFAllocatorSetDefault (CFAllocatorRef allocator); | |
100 CFAllocatorRef CFAllocatorGetDefault (); | |
101 CFAllocatorRef CFAllocatorCreate (CFAllocatorRef allocator, CFAllocatorContext* context); | |
102 void* CFAllocatorAllocate (CFAllocatorRef allocator, int size, uint hint); | |
103 void* CFAllocatorReallocate (CFAllocatorRef allocator, void* ptr, int newsize, uint hint); | |
104 void CFAllocatorDeallocate (CFAllocatorRef allocator, void* ptr); | |
105 int CFAllocatorGetPreferredSizeForSize (CFAllocatorRef allocator, int size, uint hint); | |
106 void CFAllocatorGetContext (CFAllocatorRef allocator, CFAllocatorContext* context); | |
107 uint CFGetTypeID (void* cf); | |
108 CFStringRef CFCopyTypeIDDescription (uint type_id); | |
109 void* CFRetain (void* cf); | |
110 void CFRelease (void* cf); | |
111 int CFGetRetainCount (void* cf); | |
112 void* CFMakeCollectable (void* cf); | |
113 ubyte CFEqual (void* cf1, void* cf2); | |
114 uint CFHash (void* cf); | |
115 CFStringRef CFCopyDescription (void* cf); | |
116 CFAllocatorRef CFGetAllocator (void* cf); | |
117 } |