blob: 6d39d57d513e3bbdac7fd90e1fa4c7255687ccb4 [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#ifdef WITHOUT_FRAMEWORKS
Jack Jansend844a5f2001-08-08 15:28:03 +000030#include <Script.h>
31#include <Resources.h>
Jack Jansen94bebc02001-08-08 13:17:31 +000032#endif
33
34/*
35** Find out what the current script is.
36** Donated by Fredrik Lund.
37*/
38char *PyMac_getscript()
39{
Jack Jansen666b1e72001-10-31 12:11:48 +000040#if TARGET_API_MAC_OSX
Martin v. Löwis52ea7e92002-11-26 09:05:36 +000041 CFStringEncoding enc = CFStringGetSystemEncoding();
42 static CFStringRef name = NULL;
43 /* Return the code name for the encodings for which we have codecs. */
44 switch(enc) {
45 case kCFStringEncodingMacRoman: return "mac-roman";
46 case kCFStringEncodingMacGreek: return "mac-greek";
47 case kCFStringEncodingMacCyrillic: return "mac-cyrillic";
48 case kCFStringEncodingMacTurkish: return "mac-turkish";
49 case kCFStringEncodingMacIcelandic: return "mac-icelandic";
50 /* XXX which one is mac-latin2? */
51 }
52 if (!name) {
53 /* This leaks a an object. */
54 name = CFStringConvertEncodingToIANACharSetName(enc);
55 }
56 return CFStringGetCStringPtr(name, 0);
Jack Jansen666b1e72001-10-31 12:11:48 +000057#else
Jack Jansen94bebc02001-08-08 13:17:31 +000058 int font, script, lang;
59 font = 0;
60 font = GetSysFont();
61 script = FontToScript(font);
62 switch (script) {
63 case smRoman:
64 lang = GetScriptVariable(script, smScriptLang);
65 if (lang == langIcelandic)
66 return "mac-iceland";
67 else if (lang == langTurkish)
68 return "mac-turkish";
69 else if (lang == langGreek)
70 return "mac-greek";
71 else
72 return "mac-roman";
73 break;
74#if 0
75 /* We don't have a codec for this, so don't return it */
76 case smJapanese:
77 return "mac-japan";
78#endif
79 case smGreek:
80 return "mac-greek";
81 case smCyrillic:
82 return "mac-cyrillic";
83 default:
84 return "ascii"; /* better than nothing */
85 }
Jack Jansen666b1e72001-10-31 12:11:48 +000086#endif /* TARGET_API_MAC_OSX */
Jack Jansen94bebc02001-08-08 13:17:31 +000087}
88
89/* Like strerror() but for Mac OS error numbers */
90char *PyMac_StrError(int err)
91{
92 static char buf[256];
93 Handle h;
94 char *str;
Jack Jansendde800e2002-11-07 23:07:05 +000095 static int errors_loaded;
Jack Jansen94bebc02001-08-08 13:17:31 +000096
97 h = GetResource('Estr', err);
Jack Jansendde800e2002-11-07 23:07:05 +000098 if (!h && !errors_loaded) {
99 /*
100 ** Attempt to open the resource file containing the
101 ** Estr resources. We ignore all errors. We also try
102 ** this only once.
103 */
Jack Jansendde800e2002-11-07 23:07:05 +0000104 PyObject *m, *rv;
Michael W. Hudson5f26dda2002-11-09 14:47:18 +0000105 errors_loaded = 1;
Jack Jansendde800e2002-11-07 23:07:05 +0000106
107 m = PyImport_ImportModule("macresource");
108 if (!m) {
109 if (Py_VerboseFlag)
110 PyErr_Print();
111 PyErr_Clear();
112 } else {
113 rv = PyObject_CallMethod(m, "open_error_resource", "");
114 if (!rv) {
115 if (Py_VerboseFlag)
116 PyErr_Print();
117 PyErr_Clear();
118 } else {
119 Py_DECREF(rv);
120 /* And try again... */
121 h = GetResource('Estr', err);
122 }
123 }
124 }
125 /*
126 ** Whether the code above succeeded or not, we won't try
127 ** again.
128 */
129 errors_loaded = 1;
130
Jack Jansen94bebc02001-08-08 13:17:31 +0000131 if ( h ) {
132 HLock(h);
133 str = (char *)*h;
134 memcpy(buf, str+1, (unsigned char)str[0]);
135 buf[(unsigned char)str[0]] = '\0';
136 HUnlock(h);
137 ReleaseResource(h);
138 } else {
Tim Peters22a51ef2001-12-04 01:11:32 +0000139 PyOS_snprintf(buf, sizeof(buf), "Mac OS error code %d", err);
Jack Jansen94bebc02001-08-08 13:17:31 +0000140 }
141 return buf;
142}
143
144/* Exception object shared by all Mac specific modules for Mac OS errors */
145PyObject *PyMac_OSErrException;
146
147/* Initialize and return PyMac_OSErrException */
148PyObject *
Jack Jansen697842f2001-09-10 22:00:39 +0000149PyMac_GetOSErrException(void)
Jack Jansen94bebc02001-08-08 13:17:31 +0000150{
151 if (PyMac_OSErrException == NULL)
Jack Jansen8fce2ef2002-10-19 22:02:21 +0000152 PyMac_OSErrException = PyErr_NewException("MacOS.Error", NULL, NULL);
Jack Jansen94bebc02001-08-08 13:17:31 +0000153 return PyMac_OSErrException;
154}
155
156/* Set a MAC-specific error from errno, and return NULL; return None if no error */
157PyObject *
158PyErr_Mac(PyObject *eobj, int err)
159{
160 char *msg;
161 PyObject *v;
162
163 if (err == 0 && !PyErr_Occurred()) {
164 Py_INCREF(Py_None);
165 return Py_None;
166 }
167 if (err == -1 && PyErr_Occurred())
168 return NULL;
169 msg = PyMac_StrError(err);
170 v = Py_BuildValue("(is)", err, msg);
171 PyErr_SetObject(eobj, v);
172 Py_DECREF(v);
173 return NULL;
174}
175
176/* Call PyErr_Mac with PyMac_OSErrException */
177PyObject *
178PyMac_Error(OSErr err)
179{
180 return PyErr_Mac(PyMac_GetOSErrException(), err);
181}
182
Jack Jansen697842f2001-09-10 22:00:39 +0000183
184#if TARGET_API_MAC_OSX
185OSErr
186PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
187{
188 FSRef fsr;
189 OSErr err;
190
191 *path = '\0';
192 err = FSpMakeFSRef(fss, &fsr);
193 if ( err == fnfErr ) {
194 /* FSSpecs can point to non-existing files, fsrefs can't. */
195 FSSpec fss2;
196 int tocopy;
197
198 err = FSMakeFSSpec(fss->vRefNum, fss->parID, "", &fss2);
199 if ( err ) return err;
200 err = FSpMakeFSRef(&fss2, &fsr);
201 if ( err ) return err;
202 err = (OSErr)FSRefMakePath(&fsr, path, len-1);
203 if ( err ) return err;
204 /* This part is not 100% safe: we append the filename part, but
205 ** I'm not sure that we don't run afoul of the various 8bit
206 ** encodings here. Will have to look this up at some point...
207 */
208 strcat(path, "/");
209 tocopy = fss->name[0];
210 if ( strlen(path) + tocopy >= len )
211 tocopy = len - strlen(path) - 1;
212 if ( tocopy > 0 )
213 strncat(path, fss->name+1, tocopy);
214 } else {
215 if ( err ) return err;
216 err = (OSErr)FSRefMakePath(&fsr, path, len);
217 if ( err ) return err;
218 }
219 return 0;
220}
221
222#endif /* TARGET_API_MAC_OSX */
Jack Jansen21ed16a2002-08-02 14:11:24 +0000223
224#ifdef WITH_NEXT_FRAMEWORK
225/*
226** In a bundle, find a file "resourceName" of type "resourceType". Return the
227** full pathname in "resourceURLCstr".
228*/
229static int
230locateResourcePy(CFStringRef resourceType, CFStringRef resourceName, char *resourceURLCStr, int length)
231{
232 CFBundleRef mainBundle = NULL;
233 CFURLRef URL, absoluteURL;
234 CFStringRef filenameString, filepathString;
235 CFIndex size, i;
236 CFArrayRef arrayRef = NULL;
237 int success = 0;
238
239#if TARGET_API_MAC_OSX
240 CFURLPathStyle thePathStyle = kCFURLPOSIXPathStyle;
241#else
242 CFURLPathStyle thePathStyle = kCFURLHFSPathStyle;
243#endif
244
245 /* Get a reference to our main bundle */
246 mainBundle = CFBundleGetMainBundle();
247
248 /* If we are running inside a bundle, look through it. Otherwise, do nothing. */
249 if (mainBundle) {
250
251 /* Look for py files in the main bundle by type */
252 arrayRef = CFBundleCopyResourceURLsOfType( mainBundle,
253 resourceType,
254 NULL );
255
256 /* See if there are any filename matches */
257 size = CFArrayGetCount(arrayRef);
258 for (i = 0; i < size; i++) {
259 URL = CFArrayGetValueAtIndex(arrayRef, i);
260 filenameString = CFURLCopyLastPathComponent(URL);
261 if (CFStringCompare(filenameString, resourceName, 0) == kCFCompareEqualTo) {
262 /* We found a match, get the file's full path */
263 absoluteURL = CFURLCopyAbsoluteURL(URL);
264 filepathString = CFURLCopyFileSystemPath(absoluteURL, thePathStyle);
265 CFRelease(absoluteURL);
266
267 /* Copy the full path into the caller's character buffer */
268 success = CFStringGetCString(filepathString, resourceURLCStr, length,
269 kCFStringEncodingMacRoman);
270
271 CFRelease(filepathString);
272 }
273 CFRelease(filenameString);
274 }
275 CFRelease(arrayRef);
276 }
277 return success;
278}
279
280/*
281** iff we are running in a .app framework then we could be
282** the main program for an applet. In that case, return the
283** script filename for the applet.
284** Otherwise return NULL.
285*/
286char *
287PyMac_GetAppletScriptFile(void)
288{
289 static char scriptpath[1024];
290
291 /* First we see whether we have __rawmain__.py and run that if it
292 ** is there. This is used for applets that want sys.argv to be
293 ** unix-like: __rawmain__ will construct it (from the initial appleevent)
294 ** and then call __main__.py.
295 */
296 if (locateResourcePy(CFSTR("py"), CFSTR("__rawmain__.py"), scriptpath, 1024)) {
297 return scriptpath;
298 } else if (locateResourcePy(CFSTR("pyc"), CFSTR("__rawmain__.pyc"), scriptpath, 1024)) {
299 return scriptpath;
300 } else if (locateResourcePy(CFSTR("py"), CFSTR("__main__.py"), scriptpath, 1024)) {
301 return scriptpath;
302 } else if (locateResourcePy(CFSTR("pyc"), CFSTR("__main__.pyc"), scriptpath, 1024)) {
303 return scriptpath;
304 }
305 return NULL;
306}
307
308#endif
309
310
Jack Jansen94bebc02001-08-08 13:17:31 +0000311/* Convert a 4-char string object argument to an OSType value */
312int
313PyMac_GetOSType(PyObject *v, OSType *pr)
314{
315 if (!PyString_Check(v) || PyString_Size(v) != 4) {
316 PyErr_SetString(PyExc_TypeError,
317 "OSType arg must be string of 4 chars");
318 return 0;
319 }
320 memcpy((char *)pr, PyString_AsString(v), 4);
321 return 1;
322}
323
324/* Convert an OSType value to a 4-char string object */
325PyObject *
326PyMac_BuildOSType(OSType t)
327{
328 return PyString_FromStringAndSize((char *)&t, 4);
329}
330
331/* Convert an NumVersion value to a 4-element tuple */
332PyObject *
333PyMac_BuildNumVersion(NumVersion t)
334{
335 return Py_BuildValue("(hhhh)", t.majorRev, t.minorAndBugRev, t.stage, t.nonRelRev);
336}
337
338
339/* Convert a Python string object to a Str255 */
340int
341PyMac_GetStr255(PyObject *v, Str255 pbuf)
342{
343 int len;
344 if (!PyString_Check(v) || (len = PyString_Size(v)) > 255) {
345 PyErr_SetString(PyExc_TypeError,
346 "Str255 arg must be string of at most 255 chars");
347 return 0;
348 }
349 pbuf[0] = len;
350 memcpy((char *)(pbuf+1), PyString_AsString(v), len);
351 return 1;
352}
353
354/* Convert a Str255 to a Python string object */
355PyObject *
356PyMac_BuildStr255(Str255 s)
357{
358 if ( s == NULL ) {
359 PyErr_SetString(PyExc_SystemError, "Str255 pointer is NULL");
360 return NULL;
361 }
362 return PyString_FromStringAndSize((char *)&s[1], (int)s[0]);
363}
364
365PyObject *
366PyMac_BuildOptStr255(Str255 s)
367{
368 if ( s == NULL ) {
369 Py_INCREF(Py_None);
370 return Py_None;
371 }
372 return PyString_FromStringAndSize((char *)&s[1], (int)s[0]);
373}
374
375
376
377/* Convert a Python object to a Rect.
378 The object must be a (left, top, right, bottom) tuple.
379 (This differs from the order in the struct but is consistent with
380 the arguments to SetRect(), and also with STDWIN). */
381int
382PyMac_GetRect(PyObject *v, Rect *r)
383{
384 return PyArg_Parse(v, "(hhhh)", &r->left, &r->top, &r->right, &r->bottom);
385}
386
387/* Convert a Rect to a Python object */
388PyObject *
389PyMac_BuildRect(Rect *r)
390{
391 return Py_BuildValue("(hhhh)", r->left, r->top, r->right, r->bottom);
392}
393
394
395/* Convert a Python object to a Point.
396 The object must be a (h, v) tuple.
397 (This differs from the order in the struct but is consistent with
398 the arguments to SetPoint(), and also with STDWIN). */
399int
400PyMac_GetPoint(PyObject *v, Point *p)
401{
402 return PyArg_Parse(v, "(hh)", &p->h, &p->v);
403}
404
405/* Convert a Point to a Python object */
406PyObject *
407PyMac_BuildPoint(Point p)
408{
409 return Py_BuildValue("(hh)", p.h, p.v);
410}
411
412
413/* Convert a Python object to an EventRecord.
414 The object must be a (what, message, when, (v, h), modifiers) tuple. */
415int
416PyMac_GetEventRecord(PyObject *v, EventRecord *e)
417{
418 return PyArg_Parse(v, "(Hll(hh)H)",
419 &e->what,
420 &e->message,
421 &e->when,
422 &e->where.h,
423 &e->where.v,
424 &e->modifiers);
425}
426
427/* Convert a Rect to an EventRecord object */
428PyObject *
429PyMac_BuildEventRecord(EventRecord *e)
430{
431 return Py_BuildValue("(hll(hh)h)",
432 e->what,
433 e->message,
434 e->when,
435 e->where.h,
436 e->where.v,
437 e->modifiers);
438}
439
440/* Convert Python object to Fixed */
441int
442PyMac_GetFixed(PyObject *v, Fixed *f)
443{
444 double d;
445
446 if( !PyArg_Parse(v, "d", &d))
447 return 0;
448 *f = (Fixed)(d * 0x10000);
449 return 1;
450}
451
Jack Jansen06bd3232001-08-27 14:01:05 +0000452/* Convert a Fixed to a Python object */
Jack Jansen94bebc02001-08-08 13:17:31 +0000453PyObject *
454PyMac_BuildFixed(Fixed f)
455{
456 double d;
457
458 d = f;
459 d = d / 0x10000;
460 return Py_BuildValue("d", d);
461}
462
463/* Convert wide to/from Python int or (hi, lo) tuple. XXXX Should use Python longs */
464int
465PyMac_Getwide(PyObject *v, wide *rv)
466{
467 if (PyInt_Check(v)) {
468 rv->hi = 0;
469 rv->lo = PyInt_AsLong(v);
470 if( rv->lo & 0x80000000 )
471 rv->hi = -1;
472 return 1;
473 }
474 return PyArg_Parse(v, "(ll)", &rv->hi, &rv->lo);
475}
476
477
478PyObject *
479PyMac_Buildwide(wide *w)
480{
481 if ( (w->hi == 0 && (w->lo & 0x80000000) == 0) ||
482 (w->hi == -1 && (w->lo & 0x80000000) ) )
483 return PyInt_FromLong(w->lo);
484 return Py_BuildValue("(ll)", w->hi, w->lo);
485}
486
487#ifdef USE_TOOLBOX_OBJECT_GLUE
488/*
489** Glue together the toolbox objects.
490**
491** Because toolbox modules interdepend on each other, they use each others
492** object types, on MacOSX/MachO this leads to the situation that they
493** cannot be dynamically loaded (or they would all have to be lumped into
494** a single .so, but this would be bad for extensibility).
495**
496** This file defines wrappers for all the _New and _Convert functions,
497** which are the Py_BuildValue and PyArg_ParseTuple helpers. The wrappers
498** check an indirection function pointer, and if it isn't filled in yet
499** they import the appropriate module, whose init routine should fill in
500** the pointer.
501*/
502
503#define GLUE_NEW(object, routinename, module) \
504PyObject *(*PyMacGluePtr_##routinename)(object); \
505\
506PyObject *routinename(object cobj) { \
507 if (!PyMacGluePtr_##routinename) { \
508 if (!PyImport_ImportModule(module)) return NULL; \
509 if (!PyMacGluePtr_##routinename) { \
510 PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
511 return NULL; \
512 } \
513 } \
514 return (*PyMacGluePtr_##routinename)(cobj); \
515}
516
517#define GLUE_CONVERT(object, routinename, module) \
518int (*PyMacGluePtr_##routinename)(PyObject *, object *); \
519\
520int routinename(PyObject *pyobj, object *cobj) { \
521 if (!PyMacGluePtr_##routinename) { \
522 if (!PyImport_ImportModule(module)) return NULL; \
523 if (!PyMacGluePtr_##routinename) { \
524 PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
525 return NULL; \
526 } \
527 } \
528 return (*PyMacGluePtr_##routinename)(pyobj, cobj); \
529}
Jack Jansenfabd00f2001-09-01 23:39:58 +0000530
531GLUE_NEW(FSSpec *, PyMac_BuildFSSpec, "macfs")
Jack Jansen94bebc02001-08-08 13:17:31 +0000532GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "macfs")
Jack Jansenfabd00f2001-09-01 23:39:58 +0000533GLUE_NEW(FSRef *, PyMac_BuildFSRef, "macfs")
534GLUE_CONVERT(FSRef, PyMac_GetFSRef, "macfs")
Jack Jansen94bebc02001-08-08 13:17:31 +0000535
Jack Jansen06bd3232001-08-27 14:01:05 +0000536GLUE_NEW(AppleEvent *, AEDesc_New, "Carbon.AE") /* XXXX Why by address? */
537GLUE_CONVERT(AppleEvent, AEDesc_Convert, "Carbon.AE")
Jack Jansen94bebc02001-08-08 13:17:31 +0000538
Jack Jansen06bd3232001-08-27 14:01:05 +0000539GLUE_NEW(Component, CmpObj_New, "Carbon.Cm")
540GLUE_CONVERT(Component, CmpObj_Convert, "Carbon.Cm")
541GLUE_NEW(ComponentInstance, CmpInstObj_New, "Carbon.Cm")
542GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "Carbon.Cm")
Jack Jansen94bebc02001-08-08 13:17:31 +0000543
Jack Jansen06bd3232001-08-27 14:01:05 +0000544GLUE_NEW(ControlHandle, CtlObj_New, "Carbon.Ctl")
545GLUE_CONVERT(ControlHandle, CtlObj_Convert, "Carbon.Ctl")
Jack Jansen94bebc02001-08-08 13:17:31 +0000546
Jack Jansen06bd3232001-08-27 14:01:05 +0000547GLUE_NEW(DialogPtr, DlgObj_New, "Carbon.Dlg")
548GLUE_CONVERT(DialogPtr, DlgObj_Convert, "Carbon.Dlg")
549GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "Carbon.Dlg")
Jack Jansen94bebc02001-08-08 13:17:31 +0000550
Jack Jansen06bd3232001-08-27 14:01:05 +0000551GLUE_NEW(DragReference, DragObj_New, "Carbon.Drag")
552GLUE_CONVERT(DragReference, DragObj_Convert, "Carbon.Drag")
Jack Jansen94bebc02001-08-08 13:17:31 +0000553
Jack Jansen06bd3232001-08-27 14:01:05 +0000554GLUE_NEW(ListHandle, ListObj_New, "Carbon.List")
555GLUE_CONVERT(ListHandle, ListObj_Convert, "Carbon.List")
Jack Jansen94bebc02001-08-08 13:17:31 +0000556
Jack Jansen06bd3232001-08-27 14:01:05 +0000557GLUE_NEW(MenuHandle, MenuObj_New, "Carbon.Menu")
558GLUE_CONVERT(MenuHandle, MenuObj_Convert, "Carbon.Menu")
Jack Jansen94bebc02001-08-08 13:17:31 +0000559
Jack Jansen06bd3232001-08-27 14:01:05 +0000560GLUE_NEW(GrafPtr, GrafObj_New, "Carbon.Qd")
561GLUE_CONVERT(GrafPtr, GrafObj_Convert, "Carbon.Qd")
562GLUE_NEW(BitMapPtr, BMObj_New, "Carbon.Qd")
563GLUE_CONVERT(BitMapPtr, BMObj_Convert, "Carbon.Qd")
564GLUE_NEW(RGBColor *, QdRGB_New, "Carbon.Qd") /* XXXX Why? */
565GLUE_CONVERT(RGBColor, QdRGB_Convert, "Carbon.Qd")
Jack Jansen94bebc02001-08-08 13:17:31 +0000566
Jack Jansen06bd3232001-08-27 14:01:05 +0000567GLUE_NEW(GWorldPtr, GWorldObj_New, "Carbon.Qdoffs")
568GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Carbon.Qdoffs")
Jack Jansen94bebc02001-08-08 13:17:31 +0000569
Jack Jansen06bd3232001-08-27 14:01:05 +0000570GLUE_NEW(Track, TrackObj_New, "Carbon.Qt")
571GLUE_CONVERT(Track, TrackObj_Convert, "Carbon.Qt")
572GLUE_NEW(Movie, MovieObj_New, "Carbon.Qt")
573GLUE_CONVERT(Movie, MovieObj_Convert, "Carbon.Qt")
574GLUE_NEW(MovieController, MovieCtlObj_New, "Carbon.Qt")
575GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "Carbon.Qt")
576GLUE_NEW(TimeBase, TimeBaseObj_New, "Carbon.Qt")
577GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "Carbon.Qt")
578GLUE_NEW(UserData, UserDataObj_New, "Carbon.Qt")
579GLUE_CONVERT(UserData, UserDataObj_Convert, "Carbon.Qt")
580GLUE_NEW(Media, MediaObj_New, "Carbon.Qt")
581GLUE_CONVERT(Media, MediaObj_Convert, "Carbon.Qt")
Jack Jansen94bebc02001-08-08 13:17:31 +0000582
Jack Jansen06bd3232001-08-27 14:01:05 +0000583GLUE_NEW(Handle, ResObj_New, "Carbon.Res")
584GLUE_CONVERT(Handle, ResObj_Convert, "Carbon.Res")
585GLUE_NEW(Handle, OptResObj_New, "Carbon.Res")
586GLUE_CONVERT(Handle, OptResObj_Convert, "Carbon.Res")
Jack Jansen94bebc02001-08-08 13:17:31 +0000587
Jack Jansen06bd3232001-08-27 14:01:05 +0000588GLUE_NEW(TEHandle, TEObj_New, "Carbon.TE")
589GLUE_CONVERT(TEHandle, TEObj_Convert, "Carbon.TE")
Jack Jansen94bebc02001-08-08 13:17:31 +0000590
Jack Jansen06bd3232001-08-27 14:01:05 +0000591GLUE_NEW(WindowPtr, WinObj_New, "Carbon.Win")
592GLUE_CONVERT(WindowPtr, WinObj_Convert, "Carbon.Win")
593GLUE_NEW(WindowPtr, WinObj_WhichWindow, "Carbon.Win")
Jack Jansen94bebc02001-08-08 13:17:31 +0000594
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 */