Mercurial > projects > dstep
comparison dstep/coreservices/ae/AEObjects.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 21, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.coreservices.ae.AEObjects; | |
8 | |
9 //import dstep.AvailabilityMacros; | |
10 import dstep.coreservices.ae.AEDataModel; | |
11 import dstep.coreservices.ae.AppleEvents; | |
12 import dstep.coreservices.carboncore.CarbonCore; | |
13 import dstep.objc.bridge.TypeEncoding; | |
14 | |
15 alias ccntTokenRecord* ccntTokenRecPtr; | |
16 alias ccntTokenRecPtr* ccntTokenRecHandle; | |
17 alias OSLAccessorProcPtr OSLAccessorUPP; | |
18 alias OSLCompareProcPtr OSLCompareUPP; | |
19 alias OSLCountProcPtr OSLCountUPP; | |
20 alias OSLDisposeTokenProcPtr OSLDisposeTokenUPP; | |
21 alias OSLGetMarkTokenProcPtr OSLGetMarkTokenUPP; | |
22 alias OSLGetErrDescProcPtr OSLGetErrDescUPP; | |
23 alias OSLMarkProcPtr OSLMarkUPP; | |
24 alias OSLAdjustMarksProcPtr OSLAdjustMarksUPP; | |
25 | |
26 extern (C) | |
27 { | |
28 alias short function (int, int, AEDesc*) OSLAdjustMarksProcPtr; | |
29 alias short function (AEDesc*, AEDesc*, int) OSLMarkProcPtr; | |
30 alias short function (AEDesc*, uint, AEDesc*) OSLGetMarkTokenProcPtr; | |
31 alias short function (AEDesc*) OSLDisposeTokenProcPtr; | |
32 alias short function (AEDesc**) OSLGetErrDescProcPtr; | |
33 alias short function (uint, AEDesc*, AEDesc*, char*) OSLCompareProcPtr; | |
34 alias short function (uint, AEDesc*, uint, uint, AEDesc*, AEDesc*, int) OSLAccessorProcPtr; | |
35 alias short function (uint, uint, AEDesc*, long*) OSLCountProcPtr; | |
36 } | |
37 | |
38 // This is needed otherwise the enums will fail compiling with gdc | |
39 version (GNU) | |
40 { | |
41 private | |
42 { | |
43 const __kAEAND = getOSType!("AND "); | |
44 const __kAEOR = getOSType!("OR "); | |
45 const __kAENOT = getOSType!("NOT "); | |
46 const __kAEFirst = getOSType!("firs"); | |
47 const __kAELast = getOSType!("last"); | |
48 const __kAEMiddle = getOSType!("midd"); | |
49 const __kAEAny = getOSType!("any "); | |
50 const __kAEAll = getOSType!("all "); | |
51 const __kAENext = getOSType!("next"); | |
52 const __kAEPrevious = getOSType!("prev"); | |
53 const __keyAECompOperator = getOSType!("relo"); | |
54 const __keyAELogicalTerms = getOSType!("term"); | |
55 const __keyAELogicalOperator = getOSType!("logc"); | |
56 const __keyAEObject1 = getOSType!("obj1"); | |
57 const __keyAEObject2 = getOSType!("obj2"); | |
58 const __keyAEDesiredClass = getOSType!("want"); | |
59 const __keyAEContainer = getOSType!("from"); | |
60 const __keyAEKeyForm = getOSType!("form"); | |
61 const __keyAEKeyData = getOSType!("seld"); | |
62 | |
63 } | |
64 } | |
65 | |
66 // This is needed otherwise the enums will fail compiling with gdc | |
67 version (GNU) | |
68 { | |
69 private | |
70 { | |
71 const __keyAERangeStart = getOSType!("star"); | |
72 const __keyAERangeStop = getOSType!("stop"); | |
73 const __keyDisposeTokenProc = getOSType!("xtok"); | |
74 const __keyAECompareProc = getOSType!("cmpr"); | |
75 const __keyAECountProc = getOSType!("cont"); | |
76 const __keyAEMarkTokenProc = getOSType!("mkid"); | |
77 const __keyAEMarkProc = getOSType!("mark"); | |
78 const __keyAEAdjustMarksProc = getOSType!("adjm"); | |
79 const __keyAEGetErrDescProc = getOSType!("indc"); | |
80 | |
81 } | |
82 } | |
83 | |
84 // This is needed otherwise the enums will fail compiling with gdc | |
85 version (GNU) | |
86 { | |
87 private | |
88 { | |
89 const __formAbsolutePosition = getOSType!("indx"); | |
90 const __formRelativePosition = getOSType!("rele"); | |
91 const __formTest = getOSType!("test"); | |
92 const __formRange = getOSType!("rang"); | |
93 const __formPropertyID = getOSType!("prop"); | |
94 const __formName = getOSType!("name"); | |
95 const __formUniqueID = getOSType!("ID "); | |
96 const __typeObjectSpecifier = getOSType!("obj "); | |
97 const __typeObjectBeingExamined = getOSType!("exmn"); | |
98 const __typeCurrentContainer = getOSType!("ccnt"); | |
99 const __typeToken = getOSType!("toke"); | |
100 const __typeRelativeDescriptor = getOSType!("rel "); | |
101 const __typeAbsoluteOrdinal = getOSType!("abso"); | |
102 const __typeIndexDescriptor = getOSType!("inde"); | |
103 const __typeRangeDescriptor = getOSType!("rang"); | |
104 const __typeLogicalDescriptor = getOSType!("logi"); | |
105 const __typeCompDescriptor = getOSType!("cmpd"); | |
106 const __typeOSLTokenList = getOSType!("ostl"); | |
107 | |
108 } | |
109 } | |
110 | |
111 // This is needed otherwise the enums will fail compiling with gdc | |
112 version (GNU) | |
113 { | |
114 private | |
115 { | |
116 const __typeWhoseDescriptor = getOSType!("whos"); | |
117 const __formWhose = getOSType!("whos"); | |
118 const __typeWhoseRange = getOSType!("wrng"); | |
119 const __keyAEWhoseRangeStart = getOSType!("wstr"); | |
120 const __keyAEWhoseRangeStop = getOSType!("wstp"); | |
121 const __keyAEIndex = getOSType!("kidx"); | |
122 const __keyAETest = getOSType!("ktst"); | |
123 | |
124 } | |
125 } | |
126 | |
127 enum | |
128 { | |
129 kAEAND = getOSType!("AND "), | |
130 kAEOR = getOSType!("OR "), | |
131 kAENOT = getOSType!("NOT "), | |
132 kAEFirst = getOSType!("firs"), | |
133 kAELast = getOSType!("last"), | |
134 kAEMiddle = getOSType!("midd"), | |
135 kAEAny = getOSType!("any "), | |
136 kAEAll = getOSType!("all "), | |
137 kAENext = getOSType!("next"), | |
138 kAEPrevious = getOSType!("prev"), | |
139 keyAECompOperator = getOSType!("relo"), | |
140 keyAELogicalTerms = getOSType!("term"), | |
141 keyAELogicalOperator = getOSType!("logc"), | |
142 keyAEObject1 = getOSType!("obj1"), | |
143 keyAEObject2 = getOSType!("obj2"), | |
144 keyAEDesiredClass = getOSType!("want"), | |
145 keyAEContainer = getOSType!("from"), | |
146 keyAEKeyForm = getOSType!("form"), | |
147 keyAEKeyData = getOSType!("seld") | |
148 } | |
149 | |
150 enum | |
151 { | |
152 keyAERangeStart = getOSType!("star"), | |
153 keyAERangeStop = getOSType!("stop"), | |
154 keyDisposeTokenProc = getOSType!("xtok"), | |
155 keyAECompareProc = getOSType!("cmpr"), | |
156 keyAECountProc = getOSType!("cont"), | |
157 keyAEMarkTokenProc = getOSType!("mkid"), | |
158 keyAEMarkProc = getOSType!("mark"), | |
159 keyAEAdjustMarksProc = getOSType!("adjm"), | |
160 keyAEGetErrDescProc = getOSType!("indc") | |
161 } | |
162 | |
163 enum | |
164 { | |
165 formAbsolutePosition = getOSType!("indx"), | |
166 formRelativePosition = getOSType!("rele"), | |
167 formTest = getOSType!("test"), | |
168 formRange = getOSType!("rang"), | |
169 formPropertyID = getOSType!("prop"), | |
170 formName = getOSType!("name"), | |
171 formUniqueID = getOSType!("ID "), | |
172 typeObjectSpecifier = getOSType!("obj "), | |
173 typeObjectBeingExamined = getOSType!("exmn"), | |
174 typeCurrentContainer = getOSType!("ccnt"), | |
175 typeToken = getOSType!("toke"), | |
176 typeRelativeDescriptor = getOSType!("rel "), | |
177 typeAbsoluteOrdinal = getOSType!("abso"), | |
178 typeIndexDescriptor = getOSType!("inde"), | |
179 typeRangeDescriptor = getOSType!("rang"), | |
180 typeLogicalDescriptor = getOSType!("logi"), | |
181 typeCompDescriptor = getOSType!("cmpd"), | |
182 typeOSLTokenList = getOSType!("ostl") | |
183 } | |
184 | |
185 enum | |
186 { | |
187 kAEIDoMinimum = 0x0000, | |
188 kAEIDoWhose = 0x0001, | |
189 kAEIDoMarking = 0x0004, | |
190 kAEPassSubDescs = 0x0008, | |
191 kAEResolveNestedLists = 0x0010, | |
192 kAEHandleSimpleRanges = 0x0020, | |
193 kAEUseRelativeIterators = 0x0040 | |
194 } | |
195 | |
196 enum | |
197 { | |
198 typeWhoseDescriptor = getOSType!("whos"), | |
199 formWhose = getOSType!("whos"), | |
200 typeWhoseRange = getOSType!("wrng"), | |
201 keyAEWhoseRangeStart = getOSType!("wstr"), | |
202 keyAEWhoseRangeStop = getOSType!("wstp"), | |
203 keyAEIndex = getOSType!("kidx"), | |
204 keyAETest = getOSType!("ktst") | |
205 } | |
206 | |
207 struct ccntTokenRecord | |
208 { | |
209 uint tokenClass; | |
210 AEDesc token; | |
211 } | |
212 | |
213 extern (C) | |
214 { | |
215 OSLAccessorUPP NewOSLAccessorUPP (OSLAccessorProcPtr userRoutine); | |
216 OSLCompareUPP NewOSLCompareUPP (OSLCompareProcPtr userRoutine); | |
217 OSLCountUPP NewOSLCountUPP (OSLCountProcPtr userRoutine); | |
218 OSLDisposeTokenUPP NewOSLDisposeTokenUPP (OSLDisposeTokenProcPtr userRoutine); | |
219 OSLGetMarkTokenUPP NewOSLGetMarkTokenUPP (OSLGetMarkTokenProcPtr userRoutine); | |
220 OSLGetErrDescUPP NewOSLGetErrDescUPP (OSLGetErrDescProcPtr userRoutine); | |
221 OSLMarkUPP NewOSLMarkUPP (OSLMarkProcPtr userRoutine); | |
222 OSLAdjustMarksUPP NewOSLAdjustMarksUPP (OSLAdjustMarksProcPtr userRoutine); | |
223 void DisposeOSLAccessorUPP (OSLAccessorUPP userUPP); | |
224 void DisposeOSLCompareUPP (OSLCompareUPP userUPP); | |
225 void DisposeOSLCountUPP (OSLCountUPP userUPP); | |
226 void DisposeOSLDisposeTokenUPP (OSLDisposeTokenUPP userUPP); | |
227 void DisposeOSLGetMarkTokenUPP (OSLGetMarkTokenUPP userUPP); | |
228 void DisposeOSLGetErrDescUPP (OSLGetErrDescUPP userUPP); | |
229 void DisposeOSLMarkUPP (OSLMarkUPP userUPP); | |
230 void DisposeOSLAdjustMarksUPP (OSLAdjustMarksUPP userUPP); | |
231 short InvokeOSLAccessorUPP (uint desiredClass, AEDesc* container, uint containerClass, uint form, AEDesc* selectionData, AEDesc* value, int accessorRefcon, OSLAccessorUPP userUPP); | |
232 short InvokeOSLCompareUPP (uint oper, AEDesc* obj1, AEDesc* obj2, char* result, OSLCompareUPP userUPP); | |
233 short InvokeOSLCountUPP (uint desiredType, uint containerClass, AEDesc* container, long* result, OSLCountUPP userUPP); | |
234 short InvokeOSLDisposeTokenUPP (AEDesc* unneededToken, OSLDisposeTokenUPP userUPP); | |
235 short InvokeOSLGetMarkTokenUPP (AEDesc* dContainerToken, uint containerClass, AEDesc* result, OSLGetMarkTokenUPP userUPP); | |
236 short InvokeOSLGetErrDescUPP (AEDesc** appDescPtr, OSLGetErrDescUPP userUPP); | |
237 short InvokeOSLMarkUPP (AEDesc* dToken, AEDesc* markToken, int index, OSLMarkUPP userUPP); | |
238 short InvokeOSLAdjustMarksUPP (int newStart, int newStop, AEDesc* markToken, OSLAdjustMarksUPP userUPP); | |
239 short AEObjectInit (); | |
240 short AESetObjectCallbacks (OSLCompareUPP myCompareProc, OSLCountUPP myCountProc, OSLDisposeTokenUPP myDisposeTokenProc, OSLGetMarkTokenUPP myGetMarkTokenProc, OSLMarkUPP myMarkProc, OSLAdjustMarksUPP myAdjustMarksProc, OSLGetErrDescUPP myGetErrDescProcPtr); | |
241 short AEResolve (AEDesc* objectSpecifier, short callbackFlags, AEDesc* theToken); | |
242 short AEInstallObjectAccessor (uint desiredClass, uint containerType, OSLAccessorUPP theAccessor, int accessorRefcon, ubyte isSysHandler); | |
243 short AERemoveObjectAccessor (uint desiredClass, uint containerType, OSLAccessorUPP theAccessor, ubyte isSysHandler); | |
244 short AEGetObjectAccessor (uint desiredClass, uint containerType, OSLAccessorUPP* accessor, SRefCon* accessorRefcon, ubyte isSysHandler); | |
245 short AEDisposeToken (AEDesc* theToken); | |
246 short AECallObjectAccessor (uint desiredClass, AEDesc* containerToken, uint containerClass, uint keyForm, AEDesc* keyData, AEDesc* token); | |
247 } |