comparison dwt/internal/c/custom.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents
children
comparison
equal deleted inserted replaced
44:ca5e494f2bbf 45:d8635bb48c7c
1 module dwt.internal.c.custom;
2
3 import tango.stdc.stdlib;
4
5 import dwt.internal.cocoa.NSPoint;
6 import dwt.internal.cocoa.NSRange;
7 import dwt.internal.cocoa.NSRect;
8 import dwt.internal.cocoa.NSSize;
9 import dwt.internal.objc.cocoa.Cocoa;
10 import dwt.internal.objc.runtime;
11
12 extern (C):
13
14 static IMP drawRect_1CALLBACK;
15
16 static void drawRect(id obj, SEL sel, NSRect rect)
17 {
18 return drawRect_1CALLBACK(obj, sel, &rect);
19 }
20
21 IMP drawRect_CALLBACK (IMP func)
22 {
23 drawRect_1CALLBACK = func;
24 return cast(IMP) &drawRect;
25 }
26
27
28
29 static IMP drawInteriorWithFrame_1inView_1CALLBACK;
30
31 static void drawInteriorWithFrame_1inView(id obj, SEL sel, NSRect rect, id view)
32 {
33 return drawInteriorWithFrame_1inView_1CALLBACK(obj, sel, &rect, view);
34 }
35
36 IMP drawInteriorWithFrame_inView_CALLBACK (IMP func)
37 {
38 drawInteriorWithFrame_1inView_1CALLBACK = func;
39 return cast(IMP) &drawInteriorWithFrame_1inView;
40 }
41
42
43
44 static IMP setFrame_1CALLBACK;
45
46 static void setFrame(id obj, SEL sel, NSRect rect)
47 {
48 return setFrame_1CALLBACK(obj, sel, &rect);
49 }
50
51 IMP setFrame_CALLBACK (IMP func)
52 {
53 setFrame_1CALLBACK = func;
54 return cast(IMP) &setFrame;
55 }
56
57
58
59 static IMP setFrameOrigin_1CALLBACK;
60
61 static void setFrameOrigin(id obj, SEL sel, NSPoint point)
62 {
63 return setFrameOrigin_1CALLBACK(obj, sel, &point);
64 }
65
66 IMP setFrameOrigin_CALLBACK (IMP func)
67 {
68 setFrameOrigin_1CALLBACK = func;
69 return cast(IMP) &setFrameOrigin;
70 }
71
72
73
74 static IMP setFrameSize_1CALLBACK;
75
76 static void setFrameSize(id obj, SEL sel, NSSize size)
77 {
78 return setFrameSize_1CALLBACK(obj, sel, &size);
79 }
80
81 IMP setFrameSize_CALLBACK (IMP func)
82 {
83 setFrameSize_1CALLBACK = func;
84 return cast(IMP) &setFrameSize;
85 }
86
87
88
89 static IMP hitTest_1CALLBACK;
90
91 static void hitTest(id obj, SEL sel, NSPoint point)
92 {
93 return hitTest_1CALLBACK(obj, sel, &point);
94 }
95
96 IMP hitTest_CALLBACK (IMP func)
97 {
98 hitTest_1CALLBACK = func;
99 return cast(IMP) &hitTest;
100 }
101
102
103
104 static IMP webView_1setFrame_1CALLBACK;
105
106 static void webView_1setFrame(id obj, SEL sel, id sender, NSRect rect)
107 {
108 return webView_1setFrame_1CALLBACK(obj, sel, sender, &rect);
109 }
110
111 IMP webView_setFrame_CALLBACK (IMP func)
112 {
113 webView_1setFrame_1CALLBACK = func;
114 return cast(IMP) &webView_1setFrame;
115 }
116
117
118
119
120 static IMP markedRange_1CALLBACK;
121
122 static NSRange markedRangeProc(id obj, SEL sel)
123 {
124 NSRange* ptr = cast(NSRange*) markedRange_1CALLBACK(obj, sel);
125 NSRange range = *ptr;
126 free(ptr);
127 return range;
128 }
129
130 IMP markedRange_CALLBACK (IMP func)
131 {
132 markedRange_1CALLBACK = func;
133 return cast(IMP) &markedRangeProc;
134 }
135
136
137
138 static IMP selectedRange_1CALLBACK;
139
140 static NSRange selectedRangeProc(id obj, SEL sel)
141 {
142 NSRange* ptr = cast(NSRange*) selectedRange_1CALLBACK(obj, sel);
143 NSRange range = *ptr;
144 free(ptr);
145 return range;
146 }
147
148 IMP selectedRange_CALLBACK (IMP func)
149 {
150 selectedRange_1CALLBACK = func;
151 return cast(IMP) &selectedRangeProc;
152 }
153
154
155
156 static IMP highlightSelectionInClipRect_1CALLBACK;
157
158 static void highlightSelectionInClipRect(id obj, SEL sel, NSRect rect)
159 {
160 return highlightSelectionInClipRect_1CALLBACK(obj, sel, &rect);
161 }
162
163 IMP highlightSelectionInClipRect_CALLBACK (IMP func)
164 {
165 highlightSelectionInClipRect_1CALLBACK = func;
166 return cast(IMP) &highlightSelectionInClipRect;
167 }
168
169
170
171 static IMP attributedSubstringFromRange_1CALLBACK;
172
173 static id attributedSubstringFromRangeProc(id obj, SEL sel, NSRange arg0)
174 {
175 return attributedSubstringFromRange_1CALLBACK(obj, sel, &arg0);
176 }
177
178 IMP attributedSubstringFromRange_CALLBACK (IMP func)
179 {
180 attributedSubstringFromRange_1CALLBACK = func;
181 return cast(IMP) &attributedSubstringFromRangeProc;
182 }
183
184
185
186 static IMP setMarkedText_1selectedRange_1CALLBACK;
187
188 static void setMarkedText_1selectedRange(id obj, SEL sel, id* arg0, NSRange arg1)
189 {
190 setMarkedText_1selectedRange_1CALLBACK(obj, sel, arg0, &arg1);
191 }
192
193 IMP setMarkedText_selectedRange_CALLBACK (IMP func)
194 {
195 setMarkedText_1selectedRange_1CALLBACK = func;
196 return cast(IMP) &setMarkedText_1selectedRange;
197 }
198
199
200
201 static IMP characterIndexForPoint_1CALLBACK;
202
203 static int characterIndexForPoint(id obj, SEL sel, NSPoint point)
204 {
205 return cast(int) characterIndexForPoint_1CALLBACK(obj, sel, &point);
206 }
207
208 IMP characterIndexForPoint_CALLBACK (IMP func)
209 {
210 characterIndexForPoint_1CALLBACK = func;
211 return cast(IMP) &characterIndexForPoint;
212 }
213
214
215
216 static IMP firstRectForCharacterRange_1CALLBACK;
217
218 static NSRect firstRectForCharacterRangeProc(id obj, SEL sel, NSRange arg0)
219 {
220 NSRect* ptr = cast(NSRect*) firstRectForCharacterRange_1CALLBACK(obj, sel, &arg0);
221 NSRect result = *ptr;
222 free(ptr);
223 return result;
224 }
225
226 IMP firstRectForCharacterRange_CALLBACK (IMP func)
227 {
228 firstRectForCharacterRange_1CALLBACK = func;
229 return cast(IMP) &firstRectForCharacterRangeProc;
230 }
231
232
233
234 static IMP textView_1willChangeSelectionFromCharacterRange_1toCharacterRange_1CALLBACK;
235
236 static NSRange textView_1willChangeSelectionFromCharacterRange_1toCharacterRange(id obj, SEL sel, id aTextView, NSRange oldSelectedCharRange, NSRange newSelectedCharRange)
237 {
238 NSRange* ptr = cast(NSRange*) textView_1willChangeSelectionFromCharacterRange_1toCharacterRange_1CALLBACK(obj, sel, aTextView, &oldSelectedCharRange, &newSelectedCharRange);
239 NSRange result = *ptr;
240 free(ptr);
241 return result;
242 }
243
244 IMP textView_willChangeSelectionFromCharacterRange_toCharacterRange_CALLBACK (IMP func)
245 {
246 textView_1willChangeSelectionFromCharacterRange_1toCharacterRange_1CALLBACK = func;
247 return cast(IMP) &textView_1willChangeSelectionFromCharacterRange_1toCharacterRange;
248 }
249
250
251
252 // TODO
253 IMP draggedImage_movedTo_CALLBACK (IMP func)
254 {
255 return null;
256 }
257
258
259
260 // TODO
261 IMP draggedImage_beganAt_CALLBACK (IMP func)
262 {
263 return null;
264 }
265
266
267
268 static IMP draggedImage_1endedAt_1operation_1CALLBACK;
269
270 static void draggedImage_1endedAt_1operation(id obj, SEL sel, id image, NSPoint point, NSDragOperation op)
271 {
272 return draggedImage_1endedAt_1operation_1CALLBACK(obj, sel, image, &point, op);
273 }
274
275 IMP draggedImage_endedAt_operation_CALLBACK (IMP func)
276 {
277 draggedImage_1endedAt_1operation_1CALLBACK = func;
278 return cast(IMP) &draggedImage_1endedAt_1operation;
279 }
280
281
282
283 static IMP accessibilityHitTest_1CALLBACK;
284
285 static void accessibilityHitTest(id obj, SEL sel, NSPoint point)
286 {
287 return accessibilityHitTest_1CALLBACK(obj, sel, &point);
288 }
289
290 IMP accessibilityHitTest_CALLBACK (IMP func)
291 {
292 accessibilityHitTest_1CALLBACK = func;
293 return cast(IMP) &accessibilityHitTest;
294 }
295
296
297
298 // TODO
299 IMP dragSelectionWithEvent_offset_slideBack_CALLBACK (IMP func)
300 {
301 return null;
302 }