blob: bf101fd88a944e6141ab6505c4b9198c35681366 [file] [log] [blame]
Jack Jansen94bebc02001-08-08 13:17:31 +00001/***********************************************************
2Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam,
3The Netherlands.
4
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
9provided that the above copyright notice appear in all copies and that
10both that copyright notice and this permission notice appear in
11supporting documentation, and that the names of Stichting Mathematisch
12Centrum or CWI not be used in advertising or publicity pertaining to
13distribution of the software without specific, written prior permission.
14
15STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
23******************************************************************/
24
25
26#include "Python.h"
Jack Jansen94bebc02001-08-08 13:17:31 +000027#include "pymactoolbox.h"
28
Jack Jansen94bebc02001-08-08 13:17:31 +000029
30/*
31** Find out what the current script is.
32** Donated by Fredrik Lund.
33*/
34char *PyMac_getscript()
35{
Jack Jansen666b1e72001-10-31 12:11:48 +000036#if TARGET_API_MAC_OSX
Martin v. Löwis52ea7e92002-11-26 09:05:36 +000037 CFStringEncoding enc = CFStringGetSystemEncoding();
38 static CFStringRef name = NULL;
39 /* Return the code name for the encodings for which we have codecs. */
40 switch(enc) {
41 case kCFStringEncodingMacRoman: return "mac-roman";
42 case kCFStringEncodingMacGreek: return "mac-greek";
43 case kCFStringEncodingMacCyrillic: return "mac-cyrillic";
44 case kCFStringEncodingMacTurkish: return "mac-turkish";
45 case kCFStringEncodingMacIcelandic: return "mac-icelandic";
46 /* XXX which one is mac-latin2? */
47 }
48 if (!name) {
49 /* This leaks a an object. */
50 name = CFStringConvertEncodingToIANACharSetName(enc);
51 }
Jack Jansen0a116f32002-12-23 21:03:36 +000052 return (char *)CFStringGetCStringPtr(name, 0);
Jack Jansen666b1e72001-10-31 12:11:48 +000053#else
Jack Jansen94bebc02001-08-08 13:17:31 +000054 int font, script, lang;
55 font = 0;
56 font = GetSysFont();
57 script = FontToScript(font);
58 switch (script) {
59 case smRoman:
60 lang = GetScriptVariable(script, smScriptLang);
61 if (lang == langIcelandic)
62 return "mac-iceland";
63 else if (lang == langTurkish)
64 return "mac-turkish";
65 else if (lang == langGreek)
66 return "mac-greek";
67 else
68 return "mac-roman";
69 break;
70#if 0
71 /* We don't have a codec for this, so don't return it */
72 case smJapanese:
73 return "mac-japan";
74#endif
75 case smGreek:
76 return "mac-greek";
77 case smCyrillic:
78 return "mac-cyrillic";
79 default:
80 return "ascii"; /* better than nothing */
81 }
Jack Jansen666b1e72001-10-31 12:11:48 +000082#endif /* TARGET_API_MAC_OSX */
Jack Jansen94bebc02001-08-08 13:17:31 +000083}
84
85/* Like strerror() but for Mac OS error numbers */
86char *PyMac_StrError(int err)
87{
88 static char buf[256];
89 Handle h;
90 char *str;
Jack Jansendde800e2002-11-07 23:07:05 +000091 static int errors_loaded;
Jack Jansen94bebc02001-08-08 13:17:31 +000092
93 h = GetResource('Estr', err);
Jack Jansendde800e2002-11-07 23:07:05 +000094 if (!h && !errors_loaded) {
95 /*
96 ** Attempt to open the resource file containing the
97 ** Estr resources. We ignore all errors. We also try
98 ** this only once.
99 */
Jack Jansendde800e2002-11-07 23:07:05 +0000100 PyObject *m, *rv;
Michael W. Hudson5f26dda2002-11-09 14:47:18 +0000101 errors_loaded = 1;
Jack Jansendde800e2002-11-07 23:07:05 +0000102
103 m = PyImport_ImportModule("macresource");
104 if (!m) {
105 if (Py_VerboseFlag)
106 PyErr_Print();
107 PyErr_Clear();
108 } else {
109 rv = PyObject_CallMethod(m, "open_error_resource", "");
110 if (!rv) {
111 if (Py_VerboseFlag)
112 PyErr_Print();
113 PyErr_Clear();
114 } else {
115 Py_DECREF(rv);
116 /* And try again... */
117 h = GetResource('Estr', err);
118 }
119 }
120 }
121 /*
122 ** Whether the code above succeeded or not, we won't try
123 ** again.
124 */
125 errors_loaded = 1;
126
Jack Jansen94bebc02001-08-08 13:17:31 +0000127 if ( h ) {
128 HLock(h);
129 str = (char *)*h;
130 memcpy(buf, str+1, (unsigned char)str[0]);
131 buf[(unsigned char)str[0]] = '\0';
132 HUnlock(h);
133 ReleaseResource(h);
134 } else {
Tim Peters22a51ef2001-12-04 01:11:32 +0000135 PyOS_snprintf(buf, sizeof(buf), "Mac OS error code %d", err);
Jack Jansen94bebc02001-08-08 13:17:31 +0000136 }
137 return buf;
138}
139
140/* Exception object shared by all Mac specific modules for Mac OS errors */
141PyObject *PyMac_OSErrException;
142
143/* Initialize and return PyMac_OSErrException */
144PyObject *
Jack Jansen697842f2001-09-10 22:00:39 +0000145PyMac_GetOSErrException(void)
Jack Jansen94bebc02001-08-08 13:17:31 +0000146{
147 if (PyMac_OSErrException == NULL)
Jack Jansen8fce2ef2002-10-19 22:02:21 +0000148 PyMac_OSErrException = PyErr_NewException("MacOS.Error", NULL, NULL);
Jack Jansen94bebc02001-08-08 13:17:31 +0000149 return PyMac_OSErrException;
150}
151
152/* Set a MAC-specific error from errno, and return NULL; return None if no error */
153PyObject *
154PyErr_Mac(PyObject *eobj, int err)
155{
156 char *msg;
157 PyObject *v;
158
159 if (err == 0 && !PyErr_Occurred()) {
160 Py_INCREF(Py_None);
161 return Py_None;
162 }
163 if (err == -1 && PyErr_Occurred())
164 return NULL;
165 msg = PyMac_StrError(err);
166 v = Py_BuildValue("(is)", err, msg);
167 PyErr_SetObject(eobj, v);
168 Py_DECREF(v);
169 return NULL;
170}
171
172/* Call PyErr_Mac with PyMac_OSErrException */
173PyObject *
174PyMac_Error(OSErr err)
175{
176 return PyErr_Mac(PyMac_GetOSErrException(), err);
177}
178
Jack Jansen697842f2001-09-10 22:00:39 +0000179
180#if TARGET_API_MAC_OSX
181OSErr
182PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
183{
184 FSRef fsr;
185 OSErr err;
186
187 *path = '\0';
188 err = FSpMakeFSRef(fss, &fsr);
189 if ( err == fnfErr ) {
190 /* FSSpecs can point to non-existing files, fsrefs can't. */
191 FSSpec fss2;
192 int tocopy;
193
194 err = FSMakeFSSpec(fss->vRefNum, fss->parID, "", &fss2);
195 if ( err ) return err;
196 err = FSpMakeFSRef(&fss2, &fsr);
197 if ( err ) return err;
198 err = (OSErr)FSRefMakePath(&fsr, path, len-1);
199 if ( err ) return err;
200 /* This part is not 100% safe: we append the filename part, but
201 ** I'm not sure that we don't run afoul of the various 8bit
202 ** encodings here. Will have to look this up at some point...
203 */
204 strcat(path, "/");
205 tocopy = fss->name[0];
206 if ( strlen(path) + tocopy >= len )
207 tocopy = len - strlen(path) - 1;
208 if ( tocopy > 0 )
209 strncat(path, fss->name+1, tocopy);
210 } else {
211 if ( err ) return err;
212 err = (OSErr)FSRefMakePath(&fsr, path, len);
213 if ( err ) return err;
214 }
215 return 0;
216}
217
218#endif /* TARGET_API_MAC_OSX */
Jack Jansen21ed16a2002-08-02 14:11:24 +0000219
220#ifdef WITH_NEXT_FRAMEWORK
221/*
222** In a bundle, find a file "resourceName" of type "resourceType". Return the
223** full pathname in "resourceURLCstr".
224*/
225static int
226locateResourcePy(CFStringRef resourceType, CFStringRef resourceName, char *resourceURLCStr, int length)
227{
228 CFBundleRef mainBundle = NULL;
229 CFURLRef URL, absoluteURL;
230 CFStringRef filenameString, filepathString;
231 CFIndex size, i;
232 CFArrayRef arrayRef = NULL;
233 int success = 0;
234
235#if TARGET_API_MAC_OSX
236 CFURLPathStyle thePathStyle = kCFURLPOSIXPathStyle;
237#else
238 CFURLPathStyle thePathStyle = kCFURLHFSPathStyle;
239#endif
240
241 /* Get a reference to our main bundle */
242 mainBundle = CFBundleGetMainBundle();
243
244 /* If we are running inside a bundle, look through it. Otherwise, do nothing. */
245 if (mainBundle) {
246
247 /* Look for py files in the main bundle by type */
248 arrayRef = CFBundleCopyResourceURLsOfType( mainBundle,
249 resourceType,
250 NULL );
251
252 /* See if there are any filename matches */
253 size = CFArrayGetCount(arrayRef);
254 for (i = 0; i < size; i++) {
255 URL = CFArrayGetValueAtIndex(arrayRef, i);
256 filenameString = CFURLCopyLastPathComponent(URL);
257 if (CFStringCompare(filenameString, resourceName, 0) == kCFCompareEqualTo) {
258 /* We found a match, get the file's full path */
259 absoluteURL = CFURLCopyAbsoluteURL(URL);
260 filepathString = CFURLCopyFileSystemPath(absoluteURL, thePathStyle);
261 CFRelease(absoluteURL);
262
263 /* Copy the full path into the caller's character buffer */
264 success = CFStringGetCString(filepathString, resourceURLCStr, length,
265 kCFStringEncodingMacRoman);
266
267 CFRelease(filepathString);
268 }
269 CFRelease(filenameString);
270 }
271 CFRelease(arrayRef);
272 }
273 return success;
274}
275
276/*
277** iff we are running in a .app framework then we could be
278** the main program for an applet. In that case, return the
279** script filename for the applet.
280** Otherwise return NULL.
281*/
282char *
283PyMac_GetAppletScriptFile(void)
284{
285 static char scriptpath[1024];
286
287 /* First we see whether we have __rawmain__.py and run that if it
288 ** is there. This is used for applets that want sys.argv to be
289 ** unix-like: __rawmain__ will construct it (from the initial appleevent)
290 ** and then call __main__.py.
291 */
292 if (locateResourcePy(CFSTR("py"), CFSTR("__rawmain__.py"), scriptpath, 1024)) {
293 return scriptpath;
294 } else if (locateResourcePy(CFSTR("pyc"), CFSTR("__rawmain__.pyc"), scriptpath, 1024)) {
295 return scriptpath;
296 } else if (locateResourcePy(CFSTR("py"), CFSTR("__main__.py"), scriptpath, 1024)) {
297 return scriptpath;
298 } else if (locateResourcePy(CFSTR("pyc"), CFSTR("__main__.pyc"), scriptpath, 1024)) {
299 return scriptpath;
300 }
301 return NULL;
302}
303
304#endif
305
306
Jack Jansen94bebc02001-08-08 13:17:31 +0000307/* Convert a 4-char string object argument to an OSType value */
308int
309PyMac_GetOSType(PyObject *v, OSType *pr)
310{
311 if (!PyString_Check(v) || PyString_Size(v) != 4) {
312 PyErr_SetString(PyExc_TypeError,
313 "OSType arg must be string of 4 chars");
314 return 0;
315 }
316 memcpy((char *)pr, PyString_AsString(v), 4);
317 return 1;
318}
319
320/* Convert an OSType value to a 4-char string object */
321PyObject *
322PyMac_BuildOSType(OSType t)
323{
324 return PyString_FromStringAndSize((char *)&t, 4);
325}
326
327/* Convert an NumVersion value to a 4-element tuple */
328PyObject *
329PyMac_BuildNumVersion(NumVersion t)
330{
331 return Py_BuildValue("(hhhh)", t.majorRev, t.minorAndBugRev, t.stage, t.nonRelRev);
332}
333
334
335/* Convert a Python string object to a Str255 */
336int
337PyMac_GetStr255(PyObject *v, Str255 pbuf)
338{
339 int len;
340 if (!PyString_Check(v) || (len = PyString_Size(v)) > 255) {
341 PyErr_SetString(PyExc_TypeError,
342 "Str255 arg must be string of at most 255 chars");
343 return 0;
344 }
345 pbuf[0] = len;
346 memcpy((char *)(pbuf+1), PyString_AsString(v), len);
347 return 1;
348}
349
350/* Convert a Str255 to a Python string object */
351PyObject *
352PyMac_BuildStr255(Str255 s)
353{
354 if ( s == NULL ) {
355 PyErr_SetString(PyExc_SystemError, "Str255 pointer is NULL");
356 return NULL;
357 }
358 return PyString_FromStringAndSize((char *)&s[1], (int)s[0]);
359}
360
361PyObject *
362PyMac_BuildOptStr255(Str255 s)
363{
364 if ( s == NULL ) {
365 Py_INCREF(Py_None);
366 return Py_None;
367 }
368 return PyString_FromStringAndSize((char *)&s[1], (int)s[0]);
369}
370
371
372
373/* Convert a Python object to a Rect.
374 The object must be a (left, top, right, bottom) tuple.
375 (This differs from the order in the struct but is consistent with
376 the arguments to SetRect(), and also with STDWIN). */
377int
378PyMac_GetRect(PyObject *v, Rect *r)
379{
380 return PyArg_Parse(v, "(hhhh)", &r->left, &r->top, &r->right, &r->bottom);
381}
382
383/* Convert a Rect to a Python object */
384PyObject *
385PyMac_BuildRect(Rect *r)
386{
387 return Py_BuildValue("(hhhh)", r->left, r->top, r->right, r->bottom);
388}
389
390
391/* Convert a Python object to a Point.
392 The object must be a (h, v) tuple.
393 (This differs from the order in the struct but is consistent with
394 the arguments to SetPoint(), and also with STDWIN). */
395int
396PyMac_GetPoint(PyObject *v, Point *p)
397{
398 return PyArg_Parse(v, "(hh)", &p->h, &p->v);
399}
400
401/* Convert a Point to a Python object */
402PyObject *
403PyMac_BuildPoint(Point p)
404{
405 return Py_BuildValue("(hh)", p.h, p.v);
406}
407
408
409/* Convert a Python object to an EventRecord.
410 The object must be a (what, message, when, (v, h), modifiers) tuple. */
411int
412PyMac_GetEventRecord(PyObject *v, EventRecord *e)
413{
Jack Jansen84c2b1b2003-04-17 20:44:21 +0000414 return PyArg_Parse(v, "(Hkk(hh)H)",
Jack Jansen94bebc02001-08-08 13:17:31 +0000415 &e->what,
416 &e->message,
417 &e->when,
418 &e->where.h,
419 &e->where.v,
420 &e->modifiers);
421}
422
423/* Convert a Rect to an EventRecord object */
424PyObject *
425PyMac_BuildEventRecord(EventRecord *e)
426{
427 return Py_BuildValue("(hll(hh)h)",
428 e->what,
429 e->message,
430 e->when,
431 e->where.h,
432 e->where.v,
433 e->modifiers);
434}
435
436/* Convert Python object to Fixed */
437int
438PyMac_GetFixed(PyObject *v, Fixed *f)
439{
440 double d;
441
442 if( !PyArg_Parse(v, "d", &d))
443 return 0;
444 *f = (Fixed)(d * 0x10000);
445 return 1;
446}
447
Jack Jansen06bd3232001-08-27 14:01:05 +0000448/* Convert a Fixed to a Python object */
Jack Jansen94bebc02001-08-08 13:17:31 +0000449PyObject *
450PyMac_BuildFixed(Fixed f)
451{
452 double d;
453
454 d = f;
455 d = d / 0x10000;
456 return Py_BuildValue("d", d);
457}
458
459/* Convert wide to/from Python int or (hi, lo) tuple. XXXX Should use Python longs */
460int
461PyMac_Getwide(PyObject *v, wide *rv)
462{
463 if (PyInt_Check(v)) {
464 rv->hi = 0;
465 rv->lo = PyInt_AsLong(v);
466 if( rv->lo & 0x80000000 )
467 rv->hi = -1;
468 return 1;
469 }
Jack Jansen84c2b1b2003-04-17 20:44:21 +0000470 return PyArg_Parse(v, "(kk)", &rv->hi, &rv->lo);
Jack Jansen94bebc02001-08-08 13:17:31 +0000471}
472
473
474PyObject *
475PyMac_Buildwide(wide *w)
476{
477 if ( (w->hi == 0 && (w->lo & 0x80000000) == 0) ||
478 (w->hi == -1 && (w->lo & 0x80000000) ) )
479 return PyInt_FromLong(w->lo);
480 return Py_BuildValue("(ll)", w->hi, w->lo);
481}
482
483#ifdef USE_TOOLBOX_OBJECT_GLUE
484/*
485** Glue together the toolbox objects.
486**
487** Because toolbox modules interdepend on each other, they use each others
488** object types, on MacOSX/MachO this leads to the situation that they
489** cannot be dynamically loaded (or they would all have to be lumped into
490** a single .so, but this would be bad for extensibility).
491**
492** This file defines wrappers for all the _New and _Convert functions,
493** which are the Py_BuildValue and PyArg_ParseTuple helpers. The wrappers
494** check an indirection function pointer, and if it isn't filled in yet
495** they import the appropriate module, whose init routine should fill in
496** the pointer.
497*/
498
499#define GLUE_NEW(object, routinename, module) \
500PyObject *(*PyMacGluePtr_##routinename)(object); \
501\
502PyObject *routinename(object cobj) { \
503 if (!PyMacGluePtr_##routinename) { \
504 if (!PyImport_ImportModule(module)) return NULL; \
505 if (!PyMacGluePtr_##routinename) { \
506 PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
507 return NULL; \
508 } \
509 } \
510 return (*PyMacGluePtr_##routinename)(cobj); \
511}
512
513#define GLUE_CONVERT(object, routinename, module) \
514int (*PyMacGluePtr_##routinename)(PyObject *, object *); \
515\
516int routinename(PyObject *pyobj, object *cobj) { \
517 if (!PyMacGluePtr_##routinename) { \
518 if (!PyImport_ImportModule(module)) return NULL; \
519 if (!PyMacGluePtr_##routinename) { \
520 PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
521 return NULL; \
522 } \
523 } \
524 return (*PyMacGluePtr_##routinename)(pyobj, cobj); \
525}
Jack Jansenfabd00f2001-09-01 23:39:58 +0000526
Jack Jansenad5e76a2003-03-02 23:16:50 +0000527GLUE_NEW(FSSpec *, PyMac_BuildFSSpec, "Carbon.File")
528GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "Carbon.File")
529GLUE_NEW(FSRef *, PyMac_BuildFSRef, "Carbon.File")
530GLUE_CONVERT(FSRef, PyMac_GetFSRef, "Carbon.File")
Jack Jansen94bebc02001-08-08 13:17:31 +0000531
Jack Jansen06bd3232001-08-27 14:01:05 +0000532GLUE_NEW(AppleEvent *, AEDesc_New, "Carbon.AE") /* XXXX Why by address? */
Jack Jansenb2a57722003-01-17 23:11:17 +0000533GLUE_NEW(AppleEvent *, AEDesc_NewBorrowed, "Carbon.AE")
Jack Jansen06bd3232001-08-27 14:01:05 +0000534GLUE_CONVERT(AppleEvent, AEDesc_Convert, "Carbon.AE")
Jack Jansen94bebc02001-08-08 13:17:31 +0000535
Jack Jansen06bd3232001-08-27 14:01:05 +0000536GLUE_NEW(Component, CmpObj_New, "Carbon.Cm")
537GLUE_CONVERT(Component, CmpObj_Convert, "Carbon.Cm")
538GLUE_NEW(ComponentInstance, CmpInstObj_New, "Carbon.Cm")
539GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "Carbon.Cm")
Jack Jansen94bebc02001-08-08 13:17:31 +0000540
Jack Jansen06bd3232001-08-27 14:01:05 +0000541GLUE_NEW(ControlHandle, CtlObj_New, "Carbon.Ctl")
542GLUE_CONVERT(ControlHandle, CtlObj_Convert, "Carbon.Ctl")
Jack Jansen94bebc02001-08-08 13:17:31 +0000543
Jack Jansen06bd3232001-08-27 14:01:05 +0000544GLUE_NEW(DialogPtr, DlgObj_New, "Carbon.Dlg")
545GLUE_CONVERT(DialogPtr, DlgObj_Convert, "Carbon.Dlg")
546GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "Carbon.Dlg")
Jack Jansen94bebc02001-08-08 13:17:31 +0000547
Jack Jansen06bd3232001-08-27 14:01:05 +0000548GLUE_NEW(DragReference, DragObj_New, "Carbon.Drag")
549GLUE_CONVERT(DragReference, DragObj_Convert, "Carbon.Drag")
Jack Jansen94bebc02001-08-08 13:17:31 +0000550
Jack Jansen06bd3232001-08-27 14:01:05 +0000551GLUE_NEW(ListHandle, ListObj_New, "Carbon.List")
552GLUE_CONVERT(ListHandle, ListObj_Convert, "Carbon.List")
Jack Jansen94bebc02001-08-08 13:17:31 +0000553
Jack Jansen06bd3232001-08-27 14:01:05 +0000554GLUE_NEW(MenuHandle, MenuObj_New, "Carbon.Menu")
555GLUE_CONVERT(MenuHandle, MenuObj_Convert, "Carbon.Menu")
Jack Jansen94bebc02001-08-08 13:17:31 +0000556
Jack Jansen06bd3232001-08-27 14:01:05 +0000557GLUE_NEW(GrafPtr, GrafObj_New, "Carbon.Qd")
558GLUE_CONVERT(GrafPtr, GrafObj_Convert, "Carbon.Qd")
559GLUE_NEW(BitMapPtr, BMObj_New, "Carbon.Qd")
560GLUE_CONVERT(BitMapPtr, BMObj_Convert, "Carbon.Qd")
561GLUE_NEW(RGBColor *, QdRGB_New, "Carbon.Qd") /* XXXX Why? */
562GLUE_CONVERT(RGBColor, QdRGB_Convert, "Carbon.Qd")
Jack Jansen94bebc02001-08-08 13:17:31 +0000563
Jack Jansen06bd3232001-08-27 14:01:05 +0000564GLUE_NEW(GWorldPtr, GWorldObj_New, "Carbon.Qdoffs")
565GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Carbon.Qdoffs")
Jack Jansen94bebc02001-08-08 13:17:31 +0000566
Jack Jansen06bd3232001-08-27 14:01:05 +0000567GLUE_NEW(Track, TrackObj_New, "Carbon.Qt")
568GLUE_CONVERT(Track, TrackObj_Convert, "Carbon.Qt")
569GLUE_NEW(Movie, MovieObj_New, "Carbon.Qt")
570GLUE_CONVERT(Movie, MovieObj_Convert, "Carbon.Qt")
571GLUE_NEW(MovieController, MovieCtlObj_New, "Carbon.Qt")
572GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "Carbon.Qt")
573GLUE_NEW(TimeBase, TimeBaseObj_New, "Carbon.Qt")
574GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "Carbon.Qt")
575GLUE_NEW(UserData, UserDataObj_New, "Carbon.Qt")
576GLUE_CONVERT(UserData, UserDataObj_Convert, "Carbon.Qt")
577GLUE_NEW(Media, MediaObj_New, "Carbon.Qt")
578GLUE_CONVERT(Media, MediaObj_Convert, "Carbon.Qt")
Jack Jansen94bebc02001-08-08 13:17:31 +0000579
Jack Jansen06bd3232001-08-27 14:01:05 +0000580GLUE_NEW(Handle, ResObj_New, "Carbon.Res")
581GLUE_CONVERT(Handle, ResObj_Convert, "Carbon.Res")
582GLUE_NEW(Handle, OptResObj_New, "Carbon.Res")
583GLUE_CONVERT(Handle, OptResObj_Convert, "Carbon.Res")
Jack Jansen94bebc02001-08-08 13:17:31 +0000584
Jack Jansen06bd3232001-08-27 14:01:05 +0000585GLUE_NEW(TEHandle, TEObj_New, "Carbon.TE")
586GLUE_CONVERT(TEHandle, TEObj_Convert, "Carbon.TE")
Jack Jansen94bebc02001-08-08 13:17:31 +0000587
Jack Jansen06bd3232001-08-27 14:01:05 +0000588GLUE_NEW(WindowPtr, WinObj_New, "Carbon.Win")
589GLUE_CONVERT(WindowPtr, WinObj_Convert, "Carbon.Win")
590GLUE_NEW(WindowPtr, WinObj_WhichWindow, "Carbon.Win")
Jack Jansen94bebc02001-08-08 13:17:31 +0000591
Jack Jansen4eb45e72003-05-27 21:39:58 +0000592GLUE_CONVERT(CFTypeRef, CFObj_Convert, "Carbon.CF")
593GLUE_NEW(CFTypeRef, CFObj_New, "Carbon.CF")
594
Jack Jansen537a69f2001-11-05 14:39:22 +0000595GLUE_CONVERT(CFTypeRef, CFTypeRefObj_Convert, "Carbon.CF")
596GLUE_NEW(CFTypeRef, CFTypeRefObj_New, "Carbon.CF")
597
598GLUE_CONVERT(CFStringRef, CFStringRefObj_Convert, "Carbon.CF")
599GLUE_NEW(CFStringRef, CFStringRefObj_New, "Carbon.CF")
600GLUE_CONVERT(CFMutableStringRef, CFMutableStringRefObj_Convert, "Carbon.CF")
601GLUE_NEW(CFMutableStringRef, CFMutableStringRefObj_New, "Carbon.CF")
602
603GLUE_CONVERT(CFArrayRef, CFArrayRefObj_Convert, "Carbon.CF")
604GLUE_NEW(CFArrayRef, CFArrayRefObj_New, "Carbon.CF")
605GLUE_CONVERT(CFMutableArrayRef, CFMutableArrayRefObj_Convert, "Carbon.CF")
606GLUE_NEW(CFMutableArrayRef, CFMutableArrayRefObj_New, "Carbon.CF")
607
608GLUE_CONVERT(CFDictionaryRef, CFDictionaryRefObj_Convert, "Carbon.CF")
609GLUE_NEW(CFDictionaryRef, CFDictionaryRefObj_New, "Carbon.CF")
610GLUE_CONVERT(CFMutableDictionaryRef, CFMutableDictionaryRefObj_Convert, "Carbon.CF")
611GLUE_NEW(CFMutableDictionaryRef, CFMutableDictionaryRefObj_New, "Carbon.CF")
612
613GLUE_CONVERT(CFURLRef, CFURLRefObj_Convert, "Carbon.CF")
614GLUE_CONVERT(CFURLRef, OptionalCFURLRefObj_Convert, "Carbon.CF")
615GLUE_NEW(CFURLRef, CFURLRefObj_New, "Carbon.CF")
616
Michael W. Hudson5f26dda2002-11-09 14:47:18 +0000617#endif /* USE_TOOLBOX_OBJECT_GLUE */