blob: 7308ae4e8bd194196b35c1369ad8b805e8b02d4f [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{
Martin v. Löwis52ea7e92002-11-26 09:05:36 +000036 CFStringEncoding enc = CFStringGetSystemEncoding();
37 static CFStringRef name = NULL;
38 /* Return the code name for the encodings for which we have codecs. */
39 switch(enc) {
40 case kCFStringEncodingMacRoman: return "mac-roman";
41 case kCFStringEncodingMacGreek: return "mac-greek";
42 case kCFStringEncodingMacCyrillic: return "mac-cyrillic";
43 case kCFStringEncodingMacTurkish: return "mac-turkish";
44 case kCFStringEncodingMacIcelandic: return "mac-icelandic";
45 /* XXX which one is mac-latin2? */
46 }
47 if (!name) {
48 /* This leaks a an object. */
49 name = CFStringConvertEncodingToIANACharSetName(enc);
50 }
Jack Jansen0a116f32002-12-23 21:03:36 +000051 return (char *)CFStringGetCStringPtr(name, 0);
Jack Jansen94bebc02001-08-08 13:17:31 +000052}
53
54/* Like strerror() but for Mac OS error numbers */
55char *PyMac_StrError(int err)
56{
57 static char buf[256];
58 Handle h;
59 char *str;
Jack Jansendde800e2002-11-07 23:07:05 +000060 static int errors_loaded;
Jack Jansen94bebc02001-08-08 13:17:31 +000061
62 h = GetResource('Estr', err);
Jack Jansendde800e2002-11-07 23:07:05 +000063 if (!h && !errors_loaded) {
64 /*
65 ** Attempt to open the resource file containing the
66 ** Estr resources. We ignore all errors. We also try
67 ** this only once.
68 */
Jack Jansendde800e2002-11-07 23:07:05 +000069 PyObject *m, *rv;
Michael W. Hudson5f26dda2002-11-09 14:47:18 +000070 errors_loaded = 1;
Jack Jansendde800e2002-11-07 23:07:05 +000071
72 m = PyImport_ImportModule("macresource");
73 if (!m) {
74 if (Py_VerboseFlag)
75 PyErr_Print();
76 PyErr_Clear();
77 } else {
78 rv = PyObject_CallMethod(m, "open_error_resource", "");
79 if (!rv) {
80 if (Py_VerboseFlag)
81 PyErr_Print();
82 PyErr_Clear();
83 } else {
84 Py_DECREF(rv);
85 /* And try again... */
86 h = GetResource('Estr', err);
87 }
88 }
89 }
90 /*
91 ** Whether the code above succeeded or not, we won't try
92 ** again.
93 */
94 errors_loaded = 1;
95
Jack Jansen94bebc02001-08-08 13:17:31 +000096 if ( h ) {
97 HLock(h);
98 str = (char *)*h;
99 memcpy(buf, str+1, (unsigned char)str[0]);
100 buf[(unsigned char)str[0]] = '\0';
101 HUnlock(h);
102 ReleaseResource(h);
103 } else {
Tim Peters22a51ef2001-12-04 01:11:32 +0000104 PyOS_snprintf(buf, sizeof(buf), "Mac OS error code %d", err);
Jack Jansen94bebc02001-08-08 13:17:31 +0000105 }
106 return buf;
107}
108
109/* Exception object shared by all Mac specific modules for Mac OS errors */
110PyObject *PyMac_OSErrException;
111
112/* Initialize and return PyMac_OSErrException */
113PyObject *
Jack Jansen697842f2001-09-10 22:00:39 +0000114PyMac_GetOSErrException(void)
Jack Jansen94bebc02001-08-08 13:17:31 +0000115{
116 if (PyMac_OSErrException == NULL)
Jack Jansen8fce2ef2002-10-19 22:02:21 +0000117 PyMac_OSErrException = PyErr_NewException("MacOS.Error", NULL, NULL);
Jack Jansen94bebc02001-08-08 13:17:31 +0000118 return PyMac_OSErrException;
119}
120
121/* Set a MAC-specific error from errno, and return NULL; return None if no error */
122PyObject *
123PyErr_Mac(PyObject *eobj, int err)
124{
125 char *msg;
126 PyObject *v;
127
128 if (err == 0 && !PyErr_Occurred()) {
129 Py_INCREF(Py_None);
130 return Py_None;
131 }
132 if (err == -1 && PyErr_Occurred())
133 return NULL;
134 msg = PyMac_StrError(err);
135 v = Py_BuildValue("(is)", err, msg);
136 PyErr_SetObject(eobj, v);
137 Py_DECREF(v);
138 return NULL;
139}
140
141/* Call PyErr_Mac with PyMac_OSErrException */
142PyObject *
143PyMac_Error(OSErr err)
144{
145 return PyErr_Mac(PyMac_GetOSErrException(), err);
146}
147
Jack Jansen697842f2001-09-10 22:00:39 +0000148
Jack Jansen697842f2001-09-10 22:00:39 +0000149OSErr
150PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
151{
152 FSRef fsr;
153 OSErr err;
154
155 *path = '\0';
156 err = FSpMakeFSRef(fss, &fsr);
157 if ( err == fnfErr ) {
158 /* FSSpecs can point to non-existing files, fsrefs can't. */
159 FSSpec fss2;
160 int tocopy;
161
162 err = FSMakeFSSpec(fss->vRefNum, fss->parID, "", &fss2);
163 if ( err ) return err;
164 err = FSpMakeFSRef(&fss2, &fsr);
165 if ( err ) return err;
166 err = (OSErr)FSRefMakePath(&fsr, path, len-1);
167 if ( err ) return err;
168 /* This part is not 100% safe: we append the filename part, but
169 ** I'm not sure that we don't run afoul of the various 8bit
170 ** encodings here. Will have to look this up at some point...
171 */
172 strcat(path, "/");
173 tocopy = fss->name[0];
174 if ( strlen(path) + tocopy >= len )
175 tocopy = len - strlen(path) - 1;
176 if ( tocopy > 0 )
177 strncat(path, fss->name+1, tocopy);
178 } else {
179 if ( err ) return err;
180 err = (OSErr)FSRefMakePath(&fsr, path, len);
181 if ( err ) return err;
182 }
183 return 0;
184}
185
Jack Jansen21ed16a2002-08-02 14:11:24 +0000186
187#ifdef WITH_NEXT_FRAMEWORK
188/*
189** In a bundle, find a file "resourceName" of type "resourceType". Return the
190** full pathname in "resourceURLCstr".
191*/
192static int
193locateResourcePy(CFStringRef resourceType, CFStringRef resourceName, char *resourceURLCStr, int length)
194{
195 CFBundleRef mainBundle = NULL;
196 CFURLRef URL, absoluteURL;
197 CFStringRef filenameString, filepathString;
198 CFIndex size, i;
199 CFArrayRef arrayRef = NULL;
200 int success = 0;
201
Jack Jansen21ed16a2002-08-02 14:11:24 +0000202 CFURLPathStyle thePathStyle = kCFURLPOSIXPathStyle;
Jack Jansen21ed16a2002-08-02 14:11:24 +0000203
204 /* Get a reference to our main bundle */
205 mainBundle = CFBundleGetMainBundle();
206
207 /* If we are running inside a bundle, look through it. Otherwise, do nothing. */
208 if (mainBundle) {
209
210 /* Look for py files in the main bundle by type */
211 arrayRef = CFBundleCopyResourceURLsOfType( mainBundle,
212 resourceType,
213 NULL );
214
215 /* See if there are any filename matches */
216 size = CFArrayGetCount(arrayRef);
217 for (i = 0; i < size; i++) {
218 URL = CFArrayGetValueAtIndex(arrayRef, i);
219 filenameString = CFURLCopyLastPathComponent(URL);
220 if (CFStringCompare(filenameString, resourceName, 0) == kCFCompareEqualTo) {
221 /* We found a match, get the file's full path */
222 absoluteURL = CFURLCopyAbsoluteURL(URL);
223 filepathString = CFURLCopyFileSystemPath(absoluteURL, thePathStyle);
224 CFRelease(absoluteURL);
225
226 /* Copy the full path into the caller's character buffer */
227 success = CFStringGetCString(filepathString, resourceURLCStr, length,
228 kCFStringEncodingMacRoman);
229
230 CFRelease(filepathString);
231 }
232 CFRelease(filenameString);
233 }
234 CFRelease(arrayRef);
235 }
236 return success;
237}
238
239/*
240** iff we are running in a .app framework then we could be
241** the main program for an applet. In that case, return the
242** script filename for the applet.
243** Otherwise return NULL.
244*/
245char *
246PyMac_GetAppletScriptFile(void)
247{
248 static char scriptpath[1024];
249
250 /* First we see whether we have __rawmain__.py and run that if it
251 ** is there. This is used for applets that want sys.argv to be
252 ** unix-like: __rawmain__ will construct it (from the initial appleevent)
253 ** and then call __main__.py.
254 */
255 if (locateResourcePy(CFSTR("py"), CFSTR("__rawmain__.py"), scriptpath, 1024)) {
256 return scriptpath;
257 } else if (locateResourcePy(CFSTR("pyc"), CFSTR("__rawmain__.pyc"), scriptpath, 1024)) {
258 return scriptpath;
259 } else if (locateResourcePy(CFSTR("py"), CFSTR("__main__.py"), scriptpath, 1024)) {
260 return scriptpath;
261 } else if (locateResourcePy(CFSTR("pyc"), CFSTR("__main__.pyc"), scriptpath, 1024)) {
262 return scriptpath;
263 }
264 return NULL;
265}
266
267#endif
268
269
Jack Jansen94bebc02001-08-08 13:17:31 +0000270/* Convert a 4-char string object argument to an OSType value */
271int
272PyMac_GetOSType(PyObject *v, OSType *pr)
273{
274 if (!PyString_Check(v) || PyString_Size(v) != 4) {
275 PyErr_SetString(PyExc_TypeError,
276 "OSType arg must be string of 4 chars");
277 return 0;
278 }
279 memcpy((char *)pr, PyString_AsString(v), 4);
280 return 1;
281}
282
283/* Convert an OSType value to a 4-char string object */
284PyObject *
285PyMac_BuildOSType(OSType t)
286{
287 return PyString_FromStringAndSize((char *)&t, 4);
288}
289
290/* Convert an NumVersion value to a 4-element tuple */
291PyObject *
292PyMac_BuildNumVersion(NumVersion t)
293{
294 return Py_BuildValue("(hhhh)", t.majorRev, t.minorAndBugRev, t.stage, t.nonRelRev);
295}
296
297
298/* Convert a Python string object to a Str255 */
299int
300PyMac_GetStr255(PyObject *v, Str255 pbuf)
301{
302 int len;
303 if (!PyString_Check(v) || (len = PyString_Size(v)) > 255) {
304 PyErr_SetString(PyExc_TypeError,
305 "Str255 arg must be string of at most 255 chars");
306 return 0;
307 }
308 pbuf[0] = len;
309 memcpy((char *)(pbuf+1), PyString_AsString(v), len);
310 return 1;
311}
312
313/* Convert a Str255 to a Python string object */
314PyObject *
315PyMac_BuildStr255(Str255 s)
316{
317 if ( s == NULL ) {
318 PyErr_SetString(PyExc_SystemError, "Str255 pointer is NULL");
319 return NULL;
320 }
321 return PyString_FromStringAndSize((char *)&s[1], (int)s[0]);
322}
323
324PyObject *
325PyMac_BuildOptStr255(Str255 s)
326{
327 if ( s == NULL ) {
328 Py_INCREF(Py_None);
329 return Py_None;
330 }
331 return PyString_FromStringAndSize((char *)&s[1], (int)s[0]);
332}
333
334
335
336/* Convert a Python object to a Rect.
337 The object must be a (left, top, right, bottom) tuple.
338 (This differs from the order in the struct but is consistent with
339 the arguments to SetRect(), and also with STDWIN). */
340int
341PyMac_GetRect(PyObject *v, Rect *r)
342{
343 return PyArg_Parse(v, "(hhhh)", &r->left, &r->top, &r->right, &r->bottom);
344}
345
346/* Convert a Rect to a Python object */
347PyObject *
348PyMac_BuildRect(Rect *r)
349{
350 return Py_BuildValue("(hhhh)", r->left, r->top, r->right, r->bottom);
351}
352
353
354/* Convert a Python object to a Point.
355 The object must be a (h, v) tuple.
356 (This differs from the order in the struct but is consistent with
357 the arguments to SetPoint(), and also with STDWIN). */
358int
359PyMac_GetPoint(PyObject *v, Point *p)
360{
361 return PyArg_Parse(v, "(hh)", &p->h, &p->v);
362}
363
364/* Convert a Point to a Python object */
365PyObject *
366PyMac_BuildPoint(Point p)
367{
368 return Py_BuildValue("(hh)", p.h, p.v);
369}
370
371
372/* Convert a Python object to an EventRecord.
373 The object must be a (what, message, when, (v, h), modifiers) tuple. */
374int
375PyMac_GetEventRecord(PyObject *v, EventRecord *e)
376{
Jack Jansen84c2b1b2003-04-17 20:44:21 +0000377 return PyArg_Parse(v, "(Hkk(hh)H)",
Jack Jansen94bebc02001-08-08 13:17:31 +0000378 &e->what,
379 &e->message,
380 &e->when,
381 &e->where.h,
382 &e->where.v,
383 &e->modifiers);
384}
385
386/* Convert a Rect to an EventRecord object */
387PyObject *
388PyMac_BuildEventRecord(EventRecord *e)
389{
390 return Py_BuildValue("(hll(hh)h)",
391 e->what,
392 e->message,
393 e->when,
394 e->where.h,
395 e->where.v,
396 e->modifiers);
397}
398
399/* Convert Python object to Fixed */
400int
401PyMac_GetFixed(PyObject *v, Fixed *f)
402{
403 double d;
404
405 if( !PyArg_Parse(v, "d", &d))
406 return 0;
407 *f = (Fixed)(d * 0x10000);
408 return 1;
409}
410
Jack Jansen06bd3232001-08-27 14:01:05 +0000411/* Convert a Fixed to a Python object */
Jack Jansen94bebc02001-08-08 13:17:31 +0000412PyObject *
413PyMac_BuildFixed(Fixed f)
414{
415 double d;
416
417 d = f;
418 d = d / 0x10000;
419 return Py_BuildValue("d", d);
420}
421
422/* Convert wide to/from Python int or (hi, lo) tuple. XXXX Should use Python longs */
423int
424PyMac_Getwide(PyObject *v, wide *rv)
425{
426 if (PyInt_Check(v)) {
427 rv->hi = 0;
428 rv->lo = PyInt_AsLong(v);
429 if( rv->lo & 0x80000000 )
430 rv->hi = -1;
431 return 1;
432 }
Jack Jansen84c2b1b2003-04-17 20:44:21 +0000433 return PyArg_Parse(v, "(kk)", &rv->hi, &rv->lo);
Jack Jansen94bebc02001-08-08 13:17:31 +0000434}
435
436
437PyObject *
438PyMac_Buildwide(wide *w)
439{
440 if ( (w->hi == 0 && (w->lo & 0x80000000) == 0) ||
441 (w->hi == -1 && (w->lo & 0x80000000) ) )
442 return PyInt_FromLong(w->lo);
443 return Py_BuildValue("(ll)", w->hi, w->lo);
444}
445
446#ifdef USE_TOOLBOX_OBJECT_GLUE
447/*
448** Glue together the toolbox objects.
449**
450** Because toolbox modules interdepend on each other, they use each others
451** object types, on MacOSX/MachO this leads to the situation that they
452** cannot be dynamically loaded (or they would all have to be lumped into
453** a single .so, but this would be bad for extensibility).
454**
455** This file defines wrappers for all the _New and _Convert functions,
456** which are the Py_BuildValue and PyArg_ParseTuple helpers. The wrappers
457** check an indirection function pointer, and if it isn't filled in yet
458** they import the appropriate module, whose init routine should fill in
459** the pointer.
460*/
461
462#define GLUE_NEW(object, routinename, module) \
463PyObject *(*PyMacGluePtr_##routinename)(object); \
464\
465PyObject *routinename(object cobj) { \
466 if (!PyMacGluePtr_##routinename) { \
467 if (!PyImport_ImportModule(module)) return NULL; \
468 if (!PyMacGluePtr_##routinename) { \
469 PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
470 return NULL; \
471 } \
472 } \
473 return (*PyMacGluePtr_##routinename)(cobj); \
474}
475
476#define GLUE_CONVERT(object, routinename, module) \
477int (*PyMacGluePtr_##routinename)(PyObject *, object *); \
478\
479int routinename(PyObject *pyobj, object *cobj) { \
480 if (!PyMacGluePtr_##routinename) { \
481 if (!PyImport_ImportModule(module)) return NULL; \
482 if (!PyMacGluePtr_##routinename) { \
483 PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
484 return NULL; \
485 } \
486 } \
487 return (*PyMacGluePtr_##routinename)(pyobj, cobj); \
488}
Jack Jansenfabd00f2001-09-01 23:39:58 +0000489
Jack Jansenad5e76a2003-03-02 23:16:50 +0000490GLUE_NEW(FSSpec *, PyMac_BuildFSSpec, "Carbon.File")
491GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "Carbon.File")
492GLUE_NEW(FSRef *, PyMac_BuildFSRef, "Carbon.File")
493GLUE_CONVERT(FSRef, PyMac_GetFSRef, "Carbon.File")
Jack Jansen94bebc02001-08-08 13:17:31 +0000494
Jack Jansen06bd3232001-08-27 14:01:05 +0000495GLUE_NEW(AppleEvent *, AEDesc_New, "Carbon.AE") /* XXXX Why by address? */
Jack Jansenb2a57722003-01-17 23:11:17 +0000496GLUE_NEW(AppleEvent *, AEDesc_NewBorrowed, "Carbon.AE")
Jack Jansen06bd3232001-08-27 14:01:05 +0000497GLUE_CONVERT(AppleEvent, AEDesc_Convert, "Carbon.AE")
Jack Jansen94bebc02001-08-08 13:17:31 +0000498
Jack Jansen06bd3232001-08-27 14:01:05 +0000499GLUE_NEW(Component, CmpObj_New, "Carbon.Cm")
500GLUE_CONVERT(Component, CmpObj_Convert, "Carbon.Cm")
501GLUE_NEW(ComponentInstance, CmpInstObj_New, "Carbon.Cm")
502GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "Carbon.Cm")
Jack Jansen94bebc02001-08-08 13:17:31 +0000503
Jack Jansen06bd3232001-08-27 14:01:05 +0000504GLUE_NEW(ControlHandle, CtlObj_New, "Carbon.Ctl")
505GLUE_CONVERT(ControlHandle, CtlObj_Convert, "Carbon.Ctl")
Jack Jansen94bebc02001-08-08 13:17:31 +0000506
Jack Jansen06bd3232001-08-27 14:01:05 +0000507GLUE_NEW(DialogPtr, DlgObj_New, "Carbon.Dlg")
508GLUE_CONVERT(DialogPtr, DlgObj_Convert, "Carbon.Dlg")
509GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "Carbon.Dlg")
Jack Jansen94bebc02001-08-08 13:17:31 +0000510
Jack Jansen06bd3232001-08-27 14:01:05 +0000511GLUE_NEW(DragReference, DragObj_New, "Carbon.Drag")
512GLUE_CONVERT(DragReference, DragObj_Convert, "Carbon.Drag")
Jack Jansen94bebc02001-08-08 13:17:31 +0000513
Jack Jansen06bd3232001-08-27 14:01:05 +0000514GLUE_NEW(ListHandle, ListObj_New, "Carbon.List")
515GLUE_CONVERT(ListHandle, ListObj_Convert, "Carbon.List")
Jack Jansen94bebc02001-08-08 13:17:31 +0000516
Jack Jansen06bd3232001-08-27 14:01:05 +0000517GLUE_NEW(MenuHandle, MenuObj_New, "Carbon.Menu")
518GLUE_CONVERT(MenuHandle, MenuObj_Convert, "Carbon.Menu")
Jack Jansen94bebc02001-08-08 13:17:31 +0000519
Jack Jansen06bd3232001-08-27 14:01:05 +0000520GLUE_NEW(GrafPtr, GrafObj_New, "Carbon.Qd")
521GLUE_CONVERT(GrafPtr, GrafObj_Convert, "Carbon.Qd")
522GLUE_NEW(BitMapPtr, BMObj_New, "Carbon.Qd")
523GLUE_CONVERT(BitMapPtr, BMObj_Convert, "Carbon.Qd")
524GLUE_NEW(RGBColor *, QdRGB_New, "Carbon.Qd") /* XXXX Why? */
525GLUE_CONVERT(RGBColor, QdRGB_Convert, "Carbon.Qd")
Jack Jansen94bebc02001-08-08 13:17:31 +0000526
Jack Jansen06bd3232001-08-27 14:01:05 +0000527GLUE_NEW(GWorldPtr, GWorldObj_New, "Carbon.Qdoffs")
528GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Carbon.Qdoffs")
Jack Jansen94bebc02001-08-08 13:17:31 +0000529
Jack Jansen06bd3232001-08-27 14:01:05 +0000530GLUE_NEW(Track, TrackObj_New, "Carbon.Qt")
531GLUE_CONVERT(Track, TrackObj_Convert, "Carbon.Qt")
532GLUE_NEW(Movie, MovieObj_New, "Carbon.Qt")
533GLUE_CONVERT(Movie, MovieObj_Convert, "Carbon.Qt")
534GLUE_NEW(MovieController, MovieCtlObj_New, "Carbon.Qt")
535GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "Carbon.Qt")
536GLUE_NEW(TimeBase, TimeBaseObj_New, "Carbon.Qt")
537GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "Carbon.Qt")
538GLUE_NEW(UserData, UserDataObj_New, "Carbon.Qt")
539GLUE_CONVERT(UserData, UserDataObj_Convert, "Carbon.Qt")
540GLUE_NEW(Media, MediaObj_New, "Carbon.Qt")
541GLUE_CONVERT(Media, MediaObj_Convert, "Carbon.Qt")
Jack Jansen94bebc02001-08-08 13:17:31 +0000542
Jack Jansen06bd3232001-08-27 14:01:05 +0000543GLUE_NEW(Handle, ResObj_New, "Carbon.Res")
544GLUE_CONVERT(Handle, ResObj_Convert, "Carbon.Res")
545GLUE_NEW(Handle, OptResObj_New, "Carbon.Res")
546GLUE_CONVERT(Handle, OptResObj_Convert, "Carbon.Res")
Jack Jansen94bebc02001-08-08 13:17:31 +0000547
Jack Jansen06bd3232001-08-27 14:01:05 +0000548GLUE_NEW(TEHandle, TEObj_New, "Carbon.TE")
549GLUE_CONVERT(TEHandle, TEObj_Convert, "Carbon.TE")
Jack Jansen94bebc02001-08-08 13:17:31 +0000550
Jack Jansen06bd3232001-08-27 14:01:05 +0000551GLUE_NEW(WindowPtr, WinObj_New, "Carbon.Win")
552GLUE_CONVERT(WindowPtr, WinObj_Convert, "Carbon.Win")
553GLUE_NEW(WindowPtr, WinObj_WhichWindow, "Carbon.Win")
Jack Jansen94bebc02001-08-08 13:17:31 +0000554
Jack Jansen4eb45e72003-05-27 21:39:58 +0000555GLUE_CONVERT(CFTypeRef, CFObj_Convert, "Carbon.CF")
556GLUE_NEW(CFTypeRef, CFObj_New, "Carbon.CF")
557
Jack Jansen537a69f2001-11-05 14:39:22 +0000558GLUE_CONVERT(CFTypeRef, CFTypeRefObj_Convert, "Carbon.CF")
559GLUE_NEW(CFTypeRef, CFTypeRefObj_New, "Carbon.CF")
560
561GLUE_CONVERT(CFStringRef, CFStringRefObj_Convert, "Carbon.CF")
562GLUE_NEW(CFStringRef, CFStringRefObj_New, "Carbon.CF")
563GLUE_CONVERT(CFMutableStringRef, CFMutableStringRefObj_Convert, "Carbon.CF")
564GLUE_NEW(CFMutableStringRef, CFMutableStringRefObj_New, "Carbon.CF")
565
566GLUE_CONVERT(CFArrayRef, CFArrayRefObj_Convert, "Carbon.CF")
567GLUE_NEW(CFArrayRef, CFArrayRefObj_New, "Carbon.CF")
568GLUE_CONVERT(CFMutableArrayRef, CFMutableArrayRefObj_Convert, "Carbon.CF")
569GLUE_NEW(CFMutableArrayRef, CFMutableArrayRefObj_New, "Carbon.CF")
570
571GLUE_CONVERT(CFDictionaryRef, CFDictionaryRefObj_Convert, "Carbon.CF")
572GLUE_NEW(CFDictionaryRef, CFDictionaryRefObj_New, "Carbon.CF")
573GLUE_CONVERT(CFMutableDictionaryRef, CFMutableDictionaryRefObj_Convert, "Carbon.CF")
574GLUE_NEW(CFMutableDictionaryRef, CFMutableDictionaryRefObj_New, "Carbon.CF")
575
576GLUE_CONVERT(CFURLRef, CFURLRefObj_Convert, "Carbon.CF")
577GLUE_CONVERT(CFURLRef, OptionalCFURLRefObj_Convert, "Carbon.CF")
578GLUE_NEW(CFURLRef, CFURLRefObj_New, "Carbon.CF")
579
Michael W. Hudson5f26dda2002-11-09 14:47:18 +0000580#endif /* USE_TOOLBOX_OBJECT_GLUE */