Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 1 | /*********************************************************** |
| 2 | Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam, |
| 3 | The Netherlands. |
| 4 | |
| 5 | All Rights Reserved |
| 6 | |
| 7 | Permission to use, copy, modify, and distribute this software and its |
| 8 | documentation for any purpose and without fee is hereby granted, |
| 9 | provided that the above copyright notice appear in all copies and that |
| 10 | both that copyright notice and this permission notice appear in |
| 11 | supporting documentation, and that the names of Stichting Mathematisch |
| 12 | Centrum or CWI not be used in advertising or publicity pertaining to |
| 13 | distribution of the software without specific, written prior permission. |
| 14 | |
| 15 | STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO |
| 16 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 17 | FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE |
| 18 | FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 19 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 20 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
| 21 | OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 22 | |
| 23 | ******************************************************************/ |
| 24 | |
| 25 | |
| 26 | #include "Python.h" |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 27 | #include "pymactoolbox.h" |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 28 | #include <arpa/inet.h> /* for ntohl, htonl */ |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 29 | |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 30 | |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 31 | /* Like strerror() but for Mac OS error numbers */ |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 32 | char * |
| 33 | PyMac_StrError(int err) |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 34 | { |
| 35 | static char buf[256]; |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 36 | PyObject *m; |
| 37 | PyObject *rv; |
| 38 | |
| 39 | m = PyImport_ImportModule("MacOS"); |
| 40 | if (!m) { |
| 41 | if (Py_VerboseFlag) |
| 42 | PyErr_Print(); |
| 43 | PyErr_Clear(); |
| 44 | rv = NULL; |
| 45 | } |
| 46 | else { |
| 47 | rv = PyObject_CallMethod(m, "GetErrorString", "i", err); |
| 48 | if (!rv) |
Jack Jansen | dde800e | 2002-11-07 23:07:05 +0000 | [diff] [blame] | 49 | PyErr_Clear(); |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 50 | } |
| 51 | if (!rv) { |
| 52 | buf[0] = '\0'; |
| 53 | } |
| 54 | else { |
| 55 | char *input = PyString_AsString(rv); |
| 56 | if (!input) { |
| 57 | PyErr_Clear(); |
| 58 | buf[0] = '\0'; |
Jack Jansen | dde800e | 2002-11-07 23:07:05 +0000 | [diff] [blame] | 59 | } else { |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 60 | strncpy(buf, input, sizeof(buf) - 1); |
| 61 | buf[sizeof(buf) - 1] = '\0'; |
Jack Jansen | dde800e | 2002-11-07 23:07:05 +0000 | [diff] [blame] | 62 | } |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 63 | Py_DECREF(rv); |
Jack Jansen | dde800e | 2002-11-07 23:07:05 +0000 | [diff] [blame] | 64 | } |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 65 | Py_XDECREF(m); |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 66 | return buf; |
| 67 | } |
| 68 | |
| 69 | /* Exception object shared by all Mac specific modules for Mac OS errors */ |
| 70 | PyObject *PyMac_OSErrException; |
| 71 | |
| 72 | /* Initialize and return PyMac_OSErrException */ |
| 73 | PyObject * |
Jack Jansen | 697842f | 2001-09-10 22:00:39 +0000 | [diff] [blame] | 74 | PyMac_GetOSErrException(void) |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 75 | { |
| 76 | if (PyMac_OSErrException == NULL) |
Jack Jansen | 8fce2ef | 2002-10-19 22:02:21 +0000 | [diff] [blame] | 77 | PyMac_OSErrException = PyErr_NewException("MacOS.Error", NULL, NULL); |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 78 | return PyMac_OSErrException; |
| 79 | } |
| 80 | |
| 81 | /* Set a MAC-specific error from errno, and return NULL; return None if no error */ |
| 82 | PyObject * |
| 83 | PyErr_Mac(PyObject *eobj, int err) |
| 84 | { |
| 85 | char *msg; |
| 86 | PyObject *v; |
| 87 | |
| 88 | if (err == 0 && !PyErr_Occurred()) { |
| 89 | Py_INCREF(Py_None); |
| 90 | return Py_None; |
| 91 | } |
| 92 | if (err == -1 && PyErr_Occurred()) |
| 93 | return NULL; |
| 94 | msg = PyMac_StrError(err); |
| 95 | v = Py_BuildValue("(is)", err, msg); |
| 96 | PyErr_SetObject(eobj, v); |
| 97 | Py_DECREF(v); |
| 98 | return NULL; |
| 99 | } |
| 100 | |
| 101 | /* Call PyErr_Mac with PyMac_OSErrException */ |
| 102 | PyObject * |
| 103 | PyMac_Error(OSErr err) |
| 104 | { |
| 105 | return PyErr_Mac(PyMac_GetOSErrException(), err); |
| 106 | } |
| 107 | |
Jack Jansen | 697842f | 2001-09-10 22:00:39 +0000 | [diff] [blame] | 108 | |
Jack Jansen | 697842f | 2001-09-10 22:00:39 +0000 | [diff] [blame] | 109 | OSErr |
| 110 | PyMac_GetFullPathname(FSSpec *fss, char *path, int len) |
| 111 | { |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 112 | PyObject *fs, *exc; |
| 113 | PyObject *rv = NULL; |
| 114 | char *input; |
| 115 | OSErr err = noErr; |
| 116 | |
Jack Jansen | 697842f | 2001-09-10 22:00:39 +0000 | [diff] [blame] | 117 | *path = '\0'; |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 118 | |
| 119 | fs = PyMac_BuildFSSpec(fss); |
| 120 | if (!fs) |
| 121 | goto error; |
| 122 | |
| 123 | rv = PyObject_CallMethod(fs, "as_pathname", ""); |
| 124 | if (!rv) |
| 125 | goto error; |
| 126 | |
| 127 | input = PyString_AsString(rv); |
| 128 | if (!input) |
| 129 | goto error; |
| 130 | |
| 131 | strncpy(path, input, len - 1); |
| 132 | path[len - 1] = '\0'; |
| 133 | |
| 134 | Py_XDECREF(rv); |
| 135 | Py_XDECREF(fs); |
| 136 | return err; |
| 137 | |
| 138 | error: |
| 139 | exc = PyErr_Occurred(); |
| 140 | if (exc && PyErr_GivenExceptionMatches(exc, |
| 141 | PyMac_GetOSErrException())) { |
| 142 | PyObject *args = PyObject_GetAttrString(exc, "args"); |
| 143 | if (args) { |
| 144 | char *ignore; |
| 145 | PyArg_ParseTuple(args, "is", &err, &ignore); |
| 146 | Py_XDECREF(args); |
| 147 | } |
Jack Jansen | 697842f | 2001-09-10 22:00:39 +0000 | [diff] [blame] | 148 | } |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 149 | if (err == noErr) |
| 150 | err = -1; |
| 151 | PyErr_Clear(); |
| 152 | Py_XDECREF(rv); |
| 153 | Py_XDECREF(fs); |
| 154 | return err; |
Jack Jansen | 697842f | 2001-09-10 22:00:39 +0000 | [diff] [blame] | 155 | } |
| 156 | |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 157 | /* Convert a 4-char string object argument to an OSType value */ |
| 158 | int |
| 159 | PyMac_GetOSType(PyObject *v, OSType *pr) |
| 160 | { |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 161 | uint32_t tmp; |
Guido van Rossum | 5e23d57 | 2007-07-09 11:17:33 +0000 | [diff] [blame] | 162 | const char *str; |
| 163 | int len; |
| 164 | if (PyUnicode_Check(v)) { |
| 165 | v = _PyUnicode_AsDefaultEncodedString(v, NULL); |
| 166 | if (v == NULL) |
| 167 | return 0; |
| 168 | } |
| 169 | if (PyString_Check(v)) { |
| 170 | str = PyString_AS_STRING(v); |
| 171 | len = PyString_GET_SIZE(v); |
| 172 | } |
| 173 | else if (PyBytes_Check(v)) { |
| 174 | str = PyBytes_AS_STRING(v); |
| 175 | len = PyBytes_GET_SIZE(v); |
| 176 | } |
| 177 | else { |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 178 | PyErr_SetString(PyExc_TypeError, |
Guido van Rossum | 5e23d57 | 2007-07-09 11:17:33 +0000 | [diff] [blame] | 179 | "OSType arg must be string (of 4 chars)"); |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 180 | return 0; |
| 181 | } |
Guido van Rossum | 5e23d57 | 2007-07-09 11:17:33 +0000 | [diff] [blame] | 182 | if (len != 4) { |
| 183 | PyErr_SetString(PyExc_TypeError, |
| 184 | "OSType arg must be (string of) 4 chars"); |
| 185 | return 0; |
| 186 | } |
| 187 | memcpy((char *)&tmp, str, 4); |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 188 | *pr = (OSType)ntohl(tmp); |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 189 | return 1; |
| 190 | } |
| 191 | |
| 192 | /* Convert an OSType value to a 4-char string object */ |
| 193 | PyObject * |
| 194 | PyMac_BuildOSType(OSType t) |
| 195 | { |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 196 | uint32_t tmp = htonl((uint32_t)t); |
| 197 | return PyString_FromStringAndSize((char *)&tmp, 4); |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | /* Convert an NumVersion value to a 4-element tuple */ |
| 201 | PyObject * |
| 202 | PyMac_BuildNumVersion(NumVersion t) |
| 203 | { |
| 204 | return Py_BuildValue("(hhhh)", t.majorRev, t.minorAndBugRev, t.stage, t.nonRelRev); |
| 205 | } |
| 206 | |
| 207 | |
| 208 | /* Convert a Python string object to a Str255 */ |
| 209 | int |
| 210 | PyMac_GetStr255(PyObject *v, Str255 pbuf) |
| 211 | { |
| 212 | int len; |
| 213 | if (!PyString_Check(v) || (len = PyString_Size(v)) > 255) { |
| 214 | PyErr_SetString(PyExc_TypeError, |
| 215 | "Str255 arg must be string of at most 255 chars"); |
| 216 | return 0; |
| 217 | } |
| 218 | pbuf[0] = len; |
| 219 | memcpy((char *)(pbuf+1), PyString_AsString(v), len); |
| 220 | return 1; |
| 221 | } |
| 222 | |
| 223 | /* Convert a Str255 to a Python string object */ |
| 224 | PyObject * |
| 225 | PyMac_BuildStr255(Str255 s) |
| 226 | { |
| 227 | if ( s == NULL ) { |
| 228 | PyErr_SetString(PyExc_SystemError, "Str255 pointer is NULL"); |
| 229 | return NULL; |
| 230 | } |
| 231 | return PyString_FromStringAndSize((char *)&s[1], (int)s[0]); |
| 232 | } |
| 233 | |
| 234 | PyObject * |
| 235 | PyMac_BuildOptStr255(Str255 s) |
| 236 | { |
| 237 | if ( s == NULL ) { |
| 238 | Py_INCREF(Py_None); |
| 239 | return Py_None; |
| 240 | } |
| 241 | return PyString_FromStringAndSize((char *)&s[1], (int)s[0]); |
| 242 | } |
| 243 | |
| 244 | |
| 245 | |
| 246 | /* Convert a Python object to a Rect. |
| 247 | The object must be a (left, top, right, bottom) tuple. |
| 248 | (This differs from the order in the struct but is consistent with |
| 249 | the arguments to SetRect(), and also with STDWIN). */ |
| 250 | int |
| 251 | PyMac_GetRect(PyObject *v, Rect *r) |
| 252 | { |
| 253 | return PyArg_Parse(v, "(hhhh)", &r->left, &r->top, &r->right, &r->bottom); |
| 254 | } |
| 255 | |
| 256 | /* Convert a Rect to a Python object */ |
| 257 | PyObject * |
| 258 | PyMac_BuildRect(Rect *r) |
| 259 | { |
| 260 | return Py_BuildValue("(hhhh)", r->left, r->top, r->right, r->bottom); |
| 261 | } |
| 262 | |
| 263 | |
| 264 | /* Convert a Python object to a Point. |
| 265 | The object must be a (h, v) tuple. |
| 266 | (This differs from the order in the struct but is consistent with |
| 267 | the arguments to SetPoint(), and also with STDWIN). */ |
| 268 | int |
| 269 | PyMac_GetPoint(PyObject *v, Point *p) |
| 270 | { |
| 271 | return PyArg_Parse(v, "(hh)", &p->h, &p->v); |
| 272 | } |
| 273 | |
| 274 | /* Convert a Point to a Python object */ |
| 275 | PyObject * |
| 276 | PyMac_BuildPoint(Point p) |
| 277 | { |
| 278 | return Py_BuildValue("(hh)", p.h, p.v); |
| 279 | } |
| 280 | |
| 281 | |
| 282 | /* Convert a Python object to an EventRecord. |
| 283 | The object must be a (what, message, when, (v, h), modifiers) tuple. */ |
| 284 | int |
| 285 | PyMac_GetEventRecord(PyObject *v, EventRecord *e) |
| 286 | { |
Jack Jansen | 84c2b1b | 2003-04-17 20:44:21 +0000 | [diff] [blame] | 287 | return PyArg_Parse(v, "(Hkk(hh)H)", |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 288 | &e->what, |
| 289 | &e->message, |
| 290 | &e->when, |
| 291 | &e->where.h, |
| 292 | &e->where.v, |
| 293 | &e->modifiers); |
| 294 | } |
| 295 | |
| 296 | /* Convert a Rect to an EventRecord object */ |
| 297 | PyObject * |
| 298 | PyMac_BuildEventRecord(EventRecord *e) |
| 299 | { |
| 300 | return Py_BuildValue("(hll(hh)h)", |
| 301 | e->what, |
| 302 | e->message, |
| 303 | e->when, |
| 304 | e->where.h, |
| 305 | e->where.v, |
| 306 | e->modifiers); |
| 307 | } |
| 308 | |
| 309 | /* Convert Python object to Fixed */ |
| 310 | int |
| 311 | PyMac_GetFixed(PyObject *v, Fixed *f) |
| 312 | { |
| 313 | double d; |
| 314 | |
| 315 | if( !PyArg_Parse(v, "d", &d)) |
| 316 | return 0; |
| 317 | *f = (Fixed)(d * 0x10000); |
| 318 | return 1; |
| 319 | } |
| 320 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 321 | /* Convert a Fixed to a Python object */ |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 322 | PyObject * |
| 323 | PyMac_BuildFixed(Fixed f) |
| 324 | { |
| 325 | double d; |
| 326 | |
| 327 | d = f; |
| 328 | d = d / 0x10000; |
| 329 | return Py_BuildValue("d", d); |
| 330 | } |
| 331 | |
| 332 | /* Convert wide to/from Python int or (hi, lo) tuple. XXXX Should use Python longs */ |
| 333 | int |
| 334 | PyMac_Getwide(PyObject *v, wide *rv) |
| 335 | { |
| 336 | if (PyInt_Check(v)) { |
| 337 | rv->hi = 0; |
| 338 | rv->lo = PyInt_AsLong(v); |
| 339 | if( rv->lo & 0x80000000 ) |
| 340 | rv->hi = -1; |
| 341 | return 1; |
| 342 | } |
Jack Jansen | 84c2b1b | 2003-04-17 20:44:21 +0000 | [diff] [blame] | 343 | return PyArg_Parse(v, "(kk)", &rv->hi, &rv->lo); |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | |
| 347 | PyObject * |
| 348 | PyMac_Buildwide(wide *w) |
| 349 | { |
| 350 | if ( (w->hi == 0 && (w->lo & 0x80000000) == 0) || |
| 351 | (w->hi == -1 && (w->lo & 0x80000000) ) ) |
| 352 | return PyInt_FromLong(w->lo); |
| 353 | return Py_BuildValue("(ll)", w->hi, w->lo); |
| 354 | } |
| 355 | |
| 356 | #ifdef USE_TOOLBOX_OBJECT_GLUE |
| 357 | /* |
| 358 | ** Glue together the toolbox objects. |
| 359 | ** |
| 360 | ** Because toolbox modules interdepend on each other, they use each others |
| 361 | ** object types, on MacOSX/MachO this leads to the situation that they |
| 362 | ** cannot be dynamically loaded (or they would all have to be lumped into |
| 363 | ** a single .so, but this would be bad for extensibility). |
| 364 | ** |
| 365 | ** This file defines wrappers for all the _New and _Convert functions, |
| 366 | ** which are the Py_BuildValue and PyArg_ParseTuple helpers. The wrappers |
| 367 | ** check an indirection function pointer, and if it isn't filled in yet |
| 368 | ** they import the appropriate module, whose init routine should fill in |
| 369 | ** the pointer. |
| 370 | */ |
| 371 | |
| 372 | #define GLUE_NEW(object, routinename, module) \ |
| 373 | PyObject *(*PyMacGluePtr_##routinename)(object); \ |
| 374 | \ |
| 375 | PyObject *routinename(object cobj) { \ |
| 376 | if (!PyMacGluePtr_##routinename) { \ |
| 377 | if (!PyImport_ImportModule(module)) return NULL; \ |
| 378 | if (!PyMacGluePtr_##routinename) { \ |
| 379 | PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ |
| 380 | return NULL; \ |
| 381 | } \ |
| 382 | } \ |
| 383 | return (*PyMacGluePtr_##routinename)(cobj); \ |
| 384 | } |
| 385 | |
| 386 | #define GLUE_CONVERT(object, routinename, module) \ |
| 387 | int (*PyMacGluePtr_##routinename)(PyObject *, object *); \ |
| 388 | \ |
| 389 | int routinename(PyObject *pyobj, object *cobj) { \ |
| 390 | if (!PyMacGluePtr_##routinename) { \ |
Martin v. Löwis | 18e1655 | 2006-02-15 17:27:45 +0000 | [diff] [blame] | 391 | if (!PyImport_ImportModule(module)) return 0; \ |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 392 | if (!PyMacGluePtr_##routinename) { \ |
| 393 | PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ |
Martin v. Löwis | 18e1655 | 2006-02-15 17:27:45 +0000 | [diff] [blame] | 394 | return 0; \ |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 395 | } \ |
| 396 | } \ |
| 397 | return (*PyMacGluePtr_##routinename)(pyobj, cobj); \ |
| 398 | } |
Jack Jansen | fabd00f | 2001-09-01 23:39:58 +0000 | [diff] [blame] | 399 | |
Jack Jansen | ad5e76a | 2003-03-02 23:16:50 +0000 | [diff] [blame] | 400 | GLUE_NEW(FSSpec *, PyMac_BuildFSSpec, "Carbon.File") |
| 401 | GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "Carbon.File") |
| 402 | GLUE_NEW(FSRef *, PyMac_BuildFSRef, "Carbon.File") |
| 403 | GLUE_CONVERT(FSRef, PyMac_GetFSRef, "Carbon.File") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 404 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 405 | GLUE_NEW(AppleEvent *, AEDesc_New, "Carbon.AE") /* XXXX Why by address? */ |
Jack Jansen | b2a5772 | 2003-01-17 23:11:17 +0000 | [diff] [blame] | 406 | GLUE_NEW(AppleEvent *, AEDesc_NewBorrowed, "Carbon.AE") |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 407 | GLUE_CONVERT(AppleEvent, AEDesc_Convert, "Carbon.AE") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 408 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 409 | GLUE_NEW(Component, CmpObj_New, "Carbon.Cm") |
| 410 | GLUE_CONVERT(Component, CmpObj_Convert, "Carbon.Cm") |
| 411 | GLUE_NEW(ComponentInstance, CmpInstObj_New, "Carbon.Cm") |
| 412 | GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "Carbon.Cm") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 413 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 414 | GLUE_NEW(ControlHandle, CtlObj_New, "Carbon.Ctl") |
| 415 | GLUE_CONVERT(ControlHandle, CtlObj_Convert, "Carbon.Ctl") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 416 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 417 | GLUE_NEW(DialogPtr, DlgObj_New, "Carbon.Dlg") |
| 418 | GLUE_CONVERT(DialogPtr, DlgObj_Convert, "Carbon.Dlg") |
| 419 | GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "Carbon.Dlg") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 420 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 421 | GLUE_NEW(DragReference, DragObj_New, "Carbon.Drag") |
| 422 | GLUE_CONVERT(DragReference, DragObj_Convert, "Carbon.Drag") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 423 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 424 | GLUE_NEW(ListHandle, ListObj_New, "Carbon.List") |
| 425 | GLUE_CONVERT(ListHandle, ListObj_Convert, "Carbon.List") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 426 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 427 | GLUE_NEW(MenuHandle, MenuObj_New, "Carbon.Menu") |
| 428 | GLUE_CONVERT(MenuHandle, MenuObj_Convert, "Carbon.Menu") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 429 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 430 | GLUE_NEW(GrafPtr, GrafObj_New, "Carbon.Qd") |
| 431 | GLUE_CONVERT(GrafPtr, GrafObj_Convert, "Carbon.Qd") |
| 432 | GLUE_NEW(BitMapPtr, BMObj_New, "Carbon.Qd") |
| 433 | GLUE_CONVERT(BitMapPtr, BMObj_Convert, "Carbon.Qd") |
| 434 | GLUE_NEW(RGBColor *, QdRGB_New, "Carbon.Qd") /* XXXX Why? */ |
| 435 | GLUE_CONVERT(RGBColor, QdRGB_Convert, "Carbon.Qd") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 436 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 437 | GLUE_NEW(GWorldPtr, GWorldObj_New, "Carbon.Qdoffs") |
| 438 | GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Carbon.Qdoffs") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 439 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 440 | GLUE_NEW(Track, TrackObj_New, "Carbon.Qt") |
| 441 | GLUE_CONVERT(Track, TrackObj_Convert, "Carbon.Qt") |
| 442 | GLUE_NEW(Movie, MovieObj_New, "Carbon.Qt") |
| 443 | GLUE_CONVERT(Movie, MovieObj_Convert, "Carbon.Qt") |
| 444 | GLUE_NEW(MovieController, MovieCtlObj_New, "Carbon.Qt") |
| 445 | GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "Carbon.Qt") |
| 446 | GLUE_NEW(TimeBase, TimeBaseObj_New, "Carbon.Qt") |
| 447 | GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "Carbon.Qt") |
| 448 | GLUE_NEW(UserData, UserDataObj_New, "Carbon.Qt") |
| 449 | GLUE_CONVERT(UserData, UserDataObj_Convert, "Carbon.Qt") |
| 450 | GLUE_NEW(Media, MediaObj_New, "Carbon.Qt") |
| 451 | GLUE_CONVERT(Media, MediaObj_Convert, "Carbon.Qt") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 452 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 453 | GLUE_NEW(Handle, ResObj_New, "Carbon.Res") |
| 454 | GLUE_CONVERT(Handle, ResObj_Convert, "Carbon.Res") |
| 455 | GLUE_NEW(Handle, OptResObj_New, "Carbon.Res") |
| 456 | GLUE_CONVERT(Handle, OptResObj_Convert, "Carbon.Res") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 457 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 458 | GLUE_NEW(TEHandle, TEObj_New, "Carbon.TE") |
| 459 | GLUE_CONVERT(TEHandle, TEObj_Convert, "Carbon.TE") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 460 | |
Jack Jansen | 06bd323 | 2001-08-27 14:01:05 +0000 | [diff] [blame] | 461 | GLUE_NEW(WindowPtr, WinObj_New, "Carbon.Win") |
| 462 | GLUE_CONVERT(WindowPtr, WinObj_Convert, "Carbon.Win") |
| 463 | GLUE_NEW(WindowPtr, WinObj_WhichWindow, "Carbon.Win") |
Jack Jansen | 94bebc0 | 2001-08-08 13:17:31 +0000 | [diff] [blame] | 464 | |
Jack Jansen | 4eb45e7 | 2003-05-27 21:39:58 +0000 | [diff] [blame] | 465 | GLUE_CONVERT(CFTypeRef, CFObj_Convert, "Carbon.CF") |
| 466 | GLUE_NEW(CFTypeRef, CFObj_New, "Carbon.CF") |
| 467 | |
Jack Jansen | 537a69f | 2001-11-05 14:39:22 +0000 | [diff] [blame] | 468 | GLUE_CONVERT(CFTypeRef, CFTypeRefObj_Convert, "Carbon.CF") |
| 469 | GLUE_NEW(CFTypeRef, CFTypeRefObj_New, "Carbon.CF") |
| 470 | |
| 471 | GLUE_CONVERT(CFStringRef, CFStringRefObj_Convert, "Carbon.CF") |
| 472 | GLUE_NEW(CFStringRef, CFStringRefObj_New, "Carbon.CF") |
| 473 | GLUE_CONVERT(CFMutableStringRef, CFMutableStringRefObj_Convert, "Carbon.CF") |
| 474 | GLUE_NEW(CFMutableStringRef, CFMutableStringRefObj_New, "Carbon.CF") |
| 475 | |
| 476 | GLUE_CONVERT(CFArrayRef, CFArrayRefObj_Convert, "Carbon.CF") |
| 477 | GLUE_NEW(CFArrayRef, CFArrayRefObj_New, "Carbon.CF") |
| 478 | GLUE_CONVERT(CFMutableArrayRef, CFMutableArrayRefObj_Convert, "Carbon.CF") |
| 479 | GLUE_NEW(CFMutableArrayRef, CFMutableArrayRefObj_New, "Carbon.CF") |
| 480 | |
| 481 | GLUE_CONVERT(CFDictionaryRef, CFDictionaryRefObj_Convert, "Carbon.CF") |
| 482 | GLUE_NEW(CFDictionaryRef, CFDictionaryRefObj_New, "Carbon.CF") |
| 483 | GLUE_CONVERT(CFMutableDictionaryRef, CFMutableDictionaryRefObj_Convert, "Carbon.CF") |
| 484 | GLUE_NEW(CFMutableDictionaryRef, CFMutableDictionaryRefObj_New, "Carbon.CF") |
| 485 | |
| 486 | GLUE_CONVERT(CFURLRef, CFURLRefObj_Convert, "Carbon.CF") |
| 487 | GLUE_CONVERT(CFURLRef, OptionalCFURLRefObj_Convert, "Carbon.CF") |
| 488 | GLUE_NEW(CFURLRef, CFURLRefObj_New, "Carbon.CF") |
| 489 | |
Michael W. Hudson | 5f26dda | 2002-11-09 14:47:18 +0000 | [diff] [blame] | 490 | #endif /* USE_TOOLBOX_OBJECT_GLUE */ |