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