Changeset 391 for python/trunk/Mac/Modules/icn
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Mac/Modules/icn/_Icnmodule.c
r2 r391 11 11 /* Macro to test whether a weak-loaded CFM function exists */ 12 12 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ 13 14 15 13 PyErr_SetString(PyExc_NotImplementedError, \ 14 "Not available in this shared library/OS version"); \ 15 return NULL; \ 16 16 }} while(0) 17 17 … … 24 24 static PyObject *Icn_GetCIcon(PyObject *_self, PyObject *_args) 25 25 { 26 27 28 26 PyObject *_res = NULL; 27 CIconHandle _rv; 28 SInt16 iconID; 29 29 #ifndef GetCIcon 30 31 #endif 32 33 34 35 36 37 38 30 PyMac_PRECHECK(GetCIcon); 31 #endif 32 if (!PyArg_ParseTuple(_args, "h", 33 &iconID)) 34 return NULL; 35 _rv = GetCIcon(iconID); 36 _res = Py_BuildValue("O&", 37 ResObj_New, _rv); 38 return _res; 39 39 } 40 40 41 41 static PyObject *Icn_PlotCIcon(PyObject *_self, PyObject *_args) 42 42 { 43 44 45 43 PyObject *_res = NULL; 44 Rect theRect; 45 CIconHandle theIcon; 46 46 #ifndef PlotCIcon 47 48 #endif 49 50 51 52 53 54 55 56 57 47 PyMac_PRECHECK(PlotCIcon); 48 #endif 49 if (!PyArg_ParseTuple(_args, "O&O&", 50 PyMac_GetRect, &theRect, 51 ResObj_Convert, &theIcon)) 52 return NULL; 53 PlotCIcon(&theRect, 54 theIcon); 55 Py_INCREF(Py_None); 56 _res = Py_None; 57 return _res; 58 58 } 59 59 60 60 static PyObject *Icn_DisposeCIcon(PyObject *_self, PyObject *_args) 61 61 { 62 63 62 PyObject *_res = NULL; 63 CIconHandle theIcon; 64 64 #ifndef DisposeCIcon 65 66 #endif 67 68 69 70 71 72 73 65 PyMac_PRECHECK(DisposeCIcon); 66 #endif 67 if (!PyArg_ParseTuple(_args, "O&", 68 ResObj_Convert, &theIcon)) 69 return NULL; 70 DisposeCIcon(theIcon); 71 Py_INCREF(Py_None); 72 _res = Py_None; 73 return _res; 74 74 } 75 75 76 76 static PyObject *Icn_GetIcon(PyObject *_self, PyObject *_args) 77 77 { 78 79 80 78 PyObject *_res = NULL; 79 Handle _rv; 80 SInt16 iconID; 81 81 #ifndef GetIcon 82 83 #endif 84 85 86 87 88 89 90 82 PyMac_PRECHECK(GetIcon); 83 #endif 84 if (!PyArg_ParseTuple(_args, "h", 85 &iconID)) 86 return NULL; 87 _rv = GetIcon(iconID); 88 _res = Py_BuildValue("O&", 89 ResObj_New, _rv); 90 return _res; 91 91 } 92 92 93 93 static PyObject *Icn_PlotIcon(PyObject *_self, PyObject *_args) 94 94 { 95 96 97 95 PyObject *_res = NULL; 96 Rect theRect; 97 Handle theIcon; 98 98 #ifndef PlotIcon 99 100 #endif 101 102 103 104 105 106 107 108 109 99 PyMac_PRECHECK(PlotIcon); 100 #endif 101 if (!PyArg_ParseTuple(_args, "O&O&", 102 PyMac_GetRect, &theRect, 103 ResObj_Convert, &theIcon)) 104 return NULL; 105 PlotIcon(&theRect, 106 theIcon); 107 Py_INCREF(Py_None); 108 _res = Py_None; 109 return _res; 110 110 } 111 111 112 112 static PyObject *Icn_PlotIconID(PyObject *_self, PyObject *_args) 113 113 { 114 115 116 117 118 119 114 PyObject *_res = NULL; 115 OSErr _err; 116 Rect theRect; 117 IconAlignmentType align; 118 IconTransformType transform; 119 SInt16 theResID; 120 120 #ifndef PlotIconID 121 122 #endif 123 124 125 126 127 128 129 130 131 132 133 134 135 136 121 PyMac_PRECHECK(PlotIconID); 122 #endif 123 if (!PyArg_ParseTuple(_args, "O&hhh", 124 PyMac_GetRect, &theRect, 125 &align, 126 &transform, 127 &theResID)) 128 return NULL; 129 _err = PlotIconID(&theRect, 130 align, 131 transform, 132 theResID); 133 if (_err != noErr) return PyMac_Error(_err); 134 Py_INCREF(Py_None); 135 _res = Py_None; 136 return _res; 137 137 } 138 138 139 139 static PyObject *Icn_NewIconSuite(PyObject *_self, PyObject *_args) 140 140 { 141 142 143 141 PyObject *_res = NULL; 142 OSErr _err; 143 IconSuiteRef theIconSuite; 144 144 #ifndef NewIconSuite 145 146 #endif 147 148 149 150 151 152 153 145 PyMac_PRECHECK(NewIconSuite); 146 #endif 147 if (!PyArg_ParseTuple(_args, "")) 148 return NULL; 149 _err = NewIconSuite(&theIconSuite); 150 if (_err != noErr) return PyMac_Error(_err); 151 _res = Py_BuildValue("O&", 152 ResObj_New, theIconSuite); 153 return _res; 154 154 } 155 155 156 156 static PyObject *Icn_AddIconToSuite(PyObject *_self, PyObject *_args) 157 157 { 158 159 160 161 162 158 PyObject *_res = NULL; 159 OSErr _err; 160 Handle theIconData; 161 IconSuiteRef theSuite; 162 ResType theType; 163 163 #ifndef AddIconToSuite 164 165 #endif 166 167 168 169 170 171 172 173 174 175 176 177 164 PyMac_PRECHECK(AddIconToSuite); 165 #endif 166 if (!PyArg_ParseTuple(_args, "O&O&O&", 167 ResObj_Convert, &theIconData, 168 ResObj_Convert, &theSuite, 169 PyMac_GetOSType, &theType)) 170 return NULL; 171 _err = AddIconToSuite(theIconData, 172 theSuite, 173 theType); 174 if (_err != noErr) return PyMac_Error(_err); 175 Py_INCREF(Py_None); 176 _res = Py_None; 177 return _res; 178 178 } 179 179 180 180 static PyObject *Icn_GetIconFromSuite(PyObject *_self, PyObject *_args) 181 181 { 182 183 184 185 186 182 PyObject *_res = NULL; 183 OSErr _err; 184 Handle theIconData; 185 IconSuiteRef theSuite; 186 ResType theType; 187 187 #ifndef GetIconFromSuite 188 189 #endif 190 191 192 193 194 195 196 197 198 199 200 188 PyMac_PRECHECK(GetIconFromSuite); 189 #endif 190 if (!PyArg_ParseTuple(_args, "O&O&", 191 ResObj_Convert, &theSuite, 192 PyMac_GetOSType, &theType)) 193 return NULL; 194 _err = GetIconFromSuite(&theIconData, 195 theSuite, 196 theType); 197 if (_err != noErr) return PyMac_Error(_err); 198 _res = Py_BuildValue("O&", 199 ResObj_New, theIconData); 200 return _res; 201 201 } 202 202 203 203 static PyObject *Icn_GetIconSuite(PyObject *_self, PyObject *_args) 204 204 { 205 206 207 208 209 205 PyObject *_res = NULL; 206 OSErr _err; 207 IconSuiteRef theIconSuite; 208 SInt16 theResID; 209 IconSelectorValue selector; 210 210 #ifndef GetIconSuite 211 212 #endif 213 214 215 216 217 218 219 220 221 222 223 211 PyMac_PRECHECK(GetIconSuite); 212 #endif 213 if (!PyArg_ParseTuple(_args, "hl", 214 &theResID, 215 &selector)) 216 return NULL; 217 _err = GetIconSuite(&theIconSuite, 218 theResID, 219 selector); 220 if (_err != noErr) return PyMac_Error(_err); 221 _res = Py_BuildValue("O&", 222 ResObj_New, theIconSuite); 223 return _res; 224 224 } 225 225 226 226 static PyObject *Icn_DisposeIconSuite(PyObject *_self, PyObject *_args) 227 227 { 228 229 230 231 228 PyObject *_res = NULL; 229 OSErr _err; 230 IconSuiteRef theIconSuite; 231 Boolean disposeData; 232 232 #ifndef DisposeIconSuite 233 234 #endif 235 236 237 238 239 240 241 242 243 244 233 PyMac_PRECHECK(DisposeIconSuite); 234 #endif 235 if (!PyArg_ParseTuple(_args, "O&b", 236 ResObj_Convert, &theIconSuite, 237 &disposeData)) 238 return NULL; 239 _err = DisposeIconSuite(theIconSuite, 240 disposeData); 241 if (_err != noErr) return PyMac_Error(_err); 242 Py_INCREF(Py_None); 243 _res = Py_None; 244 return _res; 245 245 } 246 246 247 247 static PyObject *Icn_PlotIconSuite(PyObject *_self, PyObject *_args) 248 248 { 249 250 251 252 253 254 249 PyObject *_res = NULL; 250 OSErr _err; 251 Rect theRect; 252 IconAlignmentType align; 253 IconTransformType transform; 254 IconSuiteRef theIconSuite; 255 255 #ifndef PlotIconSuite 256 257 #endif 258 259 260 261 262 263 264 265 266 267 268 269 270 271 256 PyMac_PRECHECK(PlotIconSuite); 257 #endif 258 if (!PyArg_ParseTuple(_args, "O&hhO&", 259 PyMac_GetRect, &theRect, 260 &align, 261 &transform, 262 ResObj_Convert, &theIconSuite)) 263 return NULL; 264 _err = PlotIconSuite(&theRect, 265 align, 266 transform, 267 theIconSuite); 268 if (_err != noErr) return PyMac_Error(_err); 269 Py_INCREF(Py_None); 270 _res = Py_None; 271 return _res; 272 272 } 273 273 274 274 static PyObject *Icn_LoadIconCache(PyObject *_self, PyObject *_args) 275 275 { 276 277 278 279 280 281 276 PyObject *_res = NULL; 277 OSErr _err; 278 Rect theRect; 279 IconAlignmentType align; 280 IconTransformType transform; 281 IconCacheRef theIconCache; 282 282 #ifndef LoadIconCache 283 284 #endif 285 286 287 288 289 290 291 292 293 294 295 296 297 298 283 PyMac_PRECHECK(LoadIconCache); 284 #endif 285 if (!PyArg_ParseTuple(_args, "O&hhO&", 286 PyMac_GetRect, &theRect, 287 &align, 288 &transform, 289 ResObj_Convert, &theIconCache)) 290 return NULL; 291 _err = LoadIconCache(&theRect, 292 align, 293 transform, 294 theIconCache); 295 if (_err != noErr) return PyMac_Error(_err); 296 Py_INCREF(Py_None); 297 _res = Py_None; 298 return _res; 299 299 } 300 300 301 301 static PyObject *Icn_GetLabel(PyObject *_self, PyObject *_args) 302 302 { 303 304 305 306 307 303 PyObject *_res = NULL; 304 OSErr _err; 305 SInt16 labelNumber; 306 RGBColor labelColor; 307 Str255 labelString; 308 308 #ifndef GetLabel 309 310 #endif 311 312 313 314 315 316 317 318 319 320 321 309 PyMac_PRECHECK(GetLabel); 310 #endif 311 if (!PyArg_ParseTuple(_args, "hO&", 312 &labelNumber, 313 PyMac_GetStr255, labelString)) 314 return NULL; 315 _err = GetLabel(labelNumber, 316 &labelColor, 317 labelString); 318 if (_err != noErr) return PyMac_Error(_err); 319 _res = Py_BuildValue("O&", 320 QdRGB_New, &labelColor); 321 return _res; 322 322 } 323 323 324 324 static PyObject *Icn_PtInIconID(PyObject *_self, PyObject *_args) 325 325 { 326 327 328 329 330 331 326 PyObject *_res = NULL; 327 Boolean _rv; 328 Point testPt; 329 Rect iconRect; 330 IconAlignmentType align; 331 SInt16 iconID; 332 332 #ifndef PtInIconID 333 334 #endif 335 336 337 338 339 340 341 342 343 344 345 346 347 333 PyMac_PRECHECK(PtInIconID); 334 #endif 335 if (!PyArg_ParseTuple(_args, "O&O&hh", 336 PyMac_GetPoint, &testPt, 337 PyMac_GetRect, &iconRect, 338 &align, 339 &iconID)) 340 return NULL; 341 _rv = PtInIconID(testPt, 342 &iconRect, 343 align, 344 iconID); 345 _res = Py_BuildValue("b", 346 _rv); 347 return _res; 348 348 } 349 349 350 350 static PyObject *Icn_PtInIconSuite(PyObject *_self, PyObject *_args) 351 351 { 352 353 354 355 356 357 352 PyObject *_res = NULL; 353 Boolean _rv; 354 Point testPt; 355 Rect iconRect; 356 IconAlignmentType align; 357 IconSuiteRef theIconSuite; 358 358 #ifndef PtInIconSuite 359 360 #endif 361 362 363 364 365 366 367 368 369 370 371 372 373 359 PyMac_PRECHECK(PtInIconSuite); 360 #endif 361 if (!PyArg_ParseTuple(_args, "O&O&hO&", 362 PyMac_GetPoint, &testPt, 363 PyMac_GetRect, &iconRect, 364 &align, 365 ResObj_Convert, &theIconSuite)) 366 return NULL; 367 _rv = PtInIconSuite(testPt, 368 &iconRect, 369 align, 370 theIconSuite); 371 _res = Py_BuildValue("b", 372 _rv); 373 return _res; 374 374 } 375 375 376 376 static PyObject *Icn_RectInIconID(PyObject *_self, PyObject *_args) 377 377 { 378 379 380 381 382 383 378 PyObject *_res = NULL; 379 Boolean _rv; 380 Rect testRect; 381 Rect iconRect; 382 IconAlignmentType align; 383 SInt16 iconID; 384 384 #ifndef RectInIconID 385 386 #endif 387 388 389 390 391 392 393 394 395 396 397 398 399 385 PyMac_PRECHECK(RectInIconID); 386 #endif 387 if (!PyArg_ParseTuple(_args, "O&O&hh", 388 PyMac_GetRect, &testRect, 389 PyMac_GetRect, &iconRect, 390 &align, 391 &iconID)) 392 return NULL; 393 _rv = RectInIconID(&testRect, 394 &iconRect, 395 align, 396 iconID); 397 _res = Py_BuildValue("b", 398 _rv); 399 return _res; 400 400 } 401 401 402 402 static PyObject *Icn_RectInIconSuite(PyObject *_self, PyObject *_args) 403 403 { 404 405 406 407 408 409 404 PyObject *_res = NULL; 405 Boolean _rv; 406 Rect testRect; 407 Rect iconRect; 408 IconAlignmentType align; 409 IconSuiteRef theIconSuite; 410 410 #ifndef RectInIconSuite 411 412 #endif 413 414 415 416 417 418 419 420 421 422 423 424 425 411 PyMac_PRECHECK(RectInIconSuite); 412 #endif 413 if (!PyArg_ParseTuple(_args, "O&O&hO&", 414 PyMac_GetRect, &testRect, 415 PyMac_GetRect, &iconRect, 416 &align, 417 ResObj_Convert, &theIconSuite)) 418 return NULL; 419 _rv = RectInIconSuite(&testRect, 420 &iconRect, 421 align, 422 theIconSuite); 423 _res = Py_BuildValue("b", 424 _rv); 425 return _res; 426 426 } 427 427 428 428 static PyObject *Icn_IconIDToRgn(PyObject *_self, PyObject *_args) 429 429 { 430 431 432 433 434 435 430 PyObject *_res = NULL; 431 OSErr _err; 432 RgnHandle theRgn; 433 Rect iconRect; 434 IconAlignmentType align; 435 SInt16 iconID; 436 436 #ifndef IconIDToRgn 437 438 #endif 439 440 441 442 443 444 445 446 447 448 449 450 451 452 437 PyMac_PRECHECK(IconIDToRgn); 438 #endif 439 if (!PyArg_ParseTuple(_args, "O&O&hh", 440 ResObj_Convert, &theRgn, 441 PyMac_GetRect, &iconRect, 442 &align, 443 &iconID)) 444 return NULL; 445 _err = IconIDToRgn(theRgn, 446 &iconRect, 447 align, 448 iconID); 449 if (_err != noErr) return PyMac_Error(_err); 450 Py_INCREF(Py_None); 451 _res = Py_None; 452 return _res; 453 453 } 454 454 455 455 static PyObject *Icn_IconSuiteToRgn(PyObject *_self, PyObject *_args) 456 456 { 457 458 459 460 461 462 457 PyObject *_res = NULL; 458 OSErr _err; 459 RgnHandle theRgn; 460 Rect iconRect; 461 IconAlignmentType align; 462 IconSuiteRef theIconSuite; 463 463 #ifndef IconSuiteToRgn 464 465 #endif 466 467 468 469 470 471 472 473 474 475 476 477 478 479 464 PyMac_PRECHECK(IconSuiteToRgn); 465 #endif 466 if (!PyArg_ParseTuple(_args, "O&O&hO&", 467 ResObj_Convert, &theRgn, 468 PyMac_GetRect, &iconRect, 469 &align, 470 ResObj_Convert, &theIconSuite)) 471 return NULL; 472 _err = IconSuiteToRgn(theRgn, 473 &iconRect, 474 align, 475 theIconSuite); 476 if (_err != noErr) return PyMac_Error(_err); 477 Py_INCREF(Py_None); 478 _res = Py_None; 479 return _res; 480 480 } 481 481 482 482 static PyObject *Icn_SetSuiteLabel(PyObject *_self, PyObject *_args) 483 483 { 484 485 486 487 484 PyObject *_res = NULL; 485 OSErr _err; 486 IconSuiteRef theSuite; 487 SInt16 theLabel; 488 488 #ifndef SetSuiteLabel 489 490 #endif 491 492 493 494 495 496 497 498 499 500 489 PyMac_PRECHECK(SetSuiteLabel); 490 #endif 491 if (!PyArg_ParseTuple(_args, "O&h", 492 ResObj_Convert, &theSuite, 493 &theLabel)) 494 return NULL; 495 _err = SetSuiteLabel(theSuite, 496 theLabel); 497 if (_err != noErr) return PyMac_Error(_err); 498 Py_INCREF(Py_None); 499 _res = Py_None; 500 return _res; 501 501 } 502 502 503 503 static PyObject *Icn_GetSuiteLabel(PyObject *_self, PyObject *_args) 504 504 { 505 506 507 505 PyObject *_res = NULL; 506 SInt16 _rv; 507 IconSuiteRef theSuite; 508 508 #ifndef GetSuiteLabel 509 510 #endif 511 512 513 514 515 516 517 509 PyMac_PRECHECK(GetSuiteLabel); 510 #endif 511 if (!PyArg_ParseTuple(_args, "O&", 512 ResObj_Convert, &theSuite)) 513 return NULL; 514 _rv = GetSuiteLabel(theSuite); 515 _res = Py_BuildValue("h", 516 _rv); 517 return _res; 518 518 } 519 519 520 520 static PyObject *Icn_PlotIconHandle(PyObject *_self, PyObject *_args) 521 521 { 522 523 524 525 526 527 522 PyObject *_res = NULL; 523 OSErr _err; 524 Rect theRect; 525 IconAlignmentType align; 526 IconTransformType transform; 527 Handle theIcon; 528 528 #ifndef PlotIconHandle 529 530 #endif 531 532 533 534 535 536 537 538 539 540 541 542 543 544 529 PyMac_PRECHECK(PlotIconHandle); 530 #endif 531 if (!PyArg_ParseTuple(_args, "O&hhO&", 532 PyMac_GetRect, &theRect, 533 &align, 534 &transform, 535 ResObj_Convert, &theIcon)) 536 return NULL; 537 _err = PlotIconHandle(&theRect, 538 align, 539 transform, 540 theIcon); 541 if (_err != noErr) return PyMac_Error(_err); 542 Py_INCREF(Py_None); 543 _res = Py_None; 544 return _res; 545 545 } 546 546 547 547 static PyObject *Icn_PlotSICNHandle(PyObject *_self, PyObject *_args) 548 548 { 549 550 551 552 553 554 549 PyObject *_res = NULL; 550 OSErr _err; 551 Rect theRect; 552 IconAlignmentType align; 553 IconTransformType transform; 554 Handle theSICN; 555 555 #ifndef PlotSICNHandle 556 557 #endif 558 559 560 561 562 563 564 565 566 567 568 569 570 571 556 PyMac_PRECHECK(PlotSICNHandle); 557 #endif 558 if (!PyArg_ParseTuple(_args, "O&hhO&", 559 PyMac_GetRect, &theRect, 560 &align, 561 &transform, 562 ResObj_Convert, &theSICN)) 563 return NULL; 564 _err = PlotSICNHandle(&theRect, 565 align, 566 transform, 567 theSICN); 568 if (_err != noErr) return PyMac_Error(_err); 569 Py_INCREF(Py_None); 570 _res = Py_None; 571 return _res; 572 572 } 573 573 574 574 static PyObject *Icn_PlotCIconHandle(PyObject *_self, PyObject *_args) 575 575 { 576 577 578 579 580 581 576 PyObject *_res = NULL; 577 OSErr _err; 578 Rect theRect; 579 IconAlignmentType align; 580 IconTransformType transform; 581 CIconHandle theCIcon; 582 582 #ifndef PlotCIconHandle 583 584 #endif 585 586 587 588 589 590 591 592 593 594 595 596 597 598 583 PyMac_PRECHECK(PlotCIconHandle); 584 #endif 585 if (!PyArg_ParseTuple(_args, "O&hhO&", 586 PyMac_GetRect, &theRect, 587 &align, 588 &transform, 589 ResObj_Convert, &theCIcon)) 590 return NULL; 591 _err = PlotCIconHandle(&theRect, 592 align, 593 transform, 594 theCIcon); 595 if (_err != noErr) return PyMac_Error(_err); 596 Py_INCREF(Py_None); 597 _res = Py_None; 598 return _res; 599 599 } 600 600 601 601 static PyObject *Icn_IconRefToIconFamily(PyObject *_self, PyObject *_args) 602 602 { 603 604 605 606 607 603 PyObject *_res = NULL; 604 OSErr _err; 605 IconRef theIconRef; 606 IconSelectorValue whichIcons; 607 IconFamilyHandle iconFamily; 608 608 #ifndef IconRefToIconFamily 609 610 #endif 611 612 613 614 615 616 617 618 619 620 621 609 PyMac_PRECHECK(IconRefToIconFamily); 610 #endif 611 if (!PyArg_ParseTuple(_args, "O&l", 612 ResObj_Convert, &theIconRef, 613 &whichIcons)) 614 return NULL; 615 _err = IconRefToIconFamily(theIconRef, 616 whichIcons, 617 &iconFamily); 618 if (_err != noErr) return PyMac_Error(_err); 619 _res = Py_BuildValue("O&", 620 ResObj_New, iconFamily); 621 return _res; 622 622 } 623 623 624 624 static PyObject *Icn_IconFamilyToIconSuite(PyObject *_self, PyObject *_args) 625 625 { 626 627 628 629 630 626 PyObject *_res = NULL; 627 OSErr _err; 628 IconFamilyHandle iconFamily; 629 IconSelectorValue whichIcons; 630 IconSuiteRef iconSuite; 631 631 #ifndef IconFamilyToIconSuite 632 633 #endif 634 635 636 637 638 639 640 641 642 643 644 632 PyMac_PRECHECK(IconFamilyToIconSuite); 633 #endif 634 if (!PyArg_ParseTuple(_args, "O&l", 635 ResObj_Convert, &iconFamily, 636 &whichIcons)) 637 return NULL; 638 _err = IconFamilyToIconSuite(iconFamily, 639 whichIcons, 640 &iconSuite); 641 if (_err != noErr) return PyMac_Error(_err); 642 _res = Py_BuildValue("O&", 643 ResObj_New, iconSuite); 644 return _res; 645 645 } 646 646 647 647 static PyObject *Icn_IconSuiteToIconFamily(PyObject *_self, PyObject *_args) 648 648 { 649 650 651 652 653 649 PyObject *_res = NULL; 650 OSErr _err; 651 IconSuiteRef iconSuite; 652 IconSelectorValue whichIcons; 653 IconFamilyHandle iconFamily; 654 654 #ifndef IconSuiteToIconFamily 655 656 #endif 657 658 659 660 661 662 663 664 665 666 667 655 PyMac_PRECHECK(IconSuiteToIconFamily); 656 #endif 657 if (!PyArg_ParseTuple(_args, "O&l", 658 ResObj_Convert, &iconSuite, 659 &whichIcons)) 660 return NULL; 661 _err = IconSuiteToIconFamily(iconSuite, 662 whichIcons, 663 &iconFamily); 664 if (_err != noErr) return PyMac_Error(_err); 665 _res = Py_BuildValue("O&", 666 ResObj_New, iconFamily); 667 return _res; 668 668 } 669 669 670 670 static PyObject *Icn_SetIconFamilyData(PyObject *_self, PyObject *_args) 671 671 { 672 673 674 675 676 672 PyObject *_res = NULL; 673 OSErr _err; 674 IconFamilyHandle iconFamily; 675 OSType iconType; 676 Handle h; 677 677 #ifndef SetIconFamilyData 678 679 #endif 680 681 682 683 684 685 686 687 688 689 690 691 678 PyMac_PRECHECK(SetIconFamilyData); 679 #endif 680 if (!PyArg_ParseTuple(_args, "O&O&O&", 681 ResObj_Convert, &iconFamily, 682 PyMac_GetOSType, &iconType, 683 ResObj_Convert, &h)) 684 return NULL; 685 _err = SetIconFamilyData(iconFamily, 686 iconType, 687 h); 688 if (_err != noErr) return PyMac_Error(_err); 689 Py_INCREF(Py_None); 690 _res = Py_None; 691 return _res; 692 692 } 693 693 694 694 static PyObject *Icn_GetIconFamilyData(PyObject *_self, PyObject *_args) 695 695 { 696 697 698 699 700 696 PyObject *_res = NULL; 697 OSErr _err; 698 IconFamilyHandle iconFamily; 699 OSType iconType; 700 Handle h; 701 701 #ifndef GetIconFamilyData 702 703 #endif 704 705 706 707 708 709 710 711 712 713 714 715 702 PyMac_PRECHECK(GetIconFamilyData); 703 #endif 704 if (!PyArg_ParseTuple(_args, "O&O&O&", 705 ResObj_Convert, &iconFamily, 706 PyMac_GetOSType, &iconType, 707 ResObj_Convert, &h)) 708 return NULL; 709 _err = GetIconFamilyData(iconFamily, 710 iconType, 711 h); 712 if (_err != noErr) return PyMac_Error(_err); 713 Py_INCREF(Py_None); 714 _res = Py_None; 715 return _res; 716 716 } 717 717 718 718 static PyObject *Icn_GetIconRefOwners(PyObject *_self, PyObject *_args) 719 719 { 720 721 722 723 720 PyObject *_res = NULL; 721 OSErr _err; 722 IconRef theIconRef; 723 UInt16 owners; 724 724 #ifndef GetIconRefOwners 725 726 #endif 727 728 729 730 731 732 733 734 735 725 PyMac_PRECHECK(GetIconRefOwners); 726 #endif 727 if (!PyArg_ParseTuple(_args, "O&", 728 ResObj_Convert, &theIconRef)) 729 return NULL; 730 _err = GetIconRefOwners(theIconRef, 731 &owners); 732 if (_err != noErr) return PyMac_Error(_err); 733 _res = Py_BuildValue("H", 734 owners); 735 return _res; 736 736 } 737 737 738 738 static PyObject *Icn_AcquireIconRef(PyObject *_self, PyObject *_args) 739 739 { 740 741 742 740 PyObject *_res = NULL; 741 OSErr _err; 742 IconRef theIconRef; 743 743 #ifndef AcquireIconRef 744 745 #endif 746 747 748 749 750 751 752 753 744 PyMac_PRECHECK(AcquireIconRef); 745 #endif 746 if (!PyArg_ParseTuple(_args, "O&", 747 ResObj_Convert, &theIconRef)) 748 return NULL; 749 _err = AcquireIconRef(theIconRef); 750 if (_err != noErr) return PyMac_Error(_err); 751 Py_INCREF(Py_None); 752 _res = Py_None; 753 return _res; 754 754 } 755 755 756 756 static PyObject *Icn_ReleaseIconRef(PyObject *_self, PyObject *_args) 757 757 { 758 759 760 758 PyObject *_res = NULL; 759 OSErr _err; 760 IconRef theIconRef; 761 761 #ifndef ReleaseIconRef 762 763 #endif 764 765 766 767 768 769 770 771 762 PyMac_PRECHECK(ReleaseIconRef); 763 #endif 764 if (!PyArg_ParseTuple(_args, "O&", 765 ResObj_Convert, &theIconRef)) 766 return NULL; 767 _err = ReleaseIconRef(theIconRef); 768 if (_err != noErr) return PyMac_Error(_err); 769 Py_INCREF(Py_None); 770 _res = Py_None; 771 return _res; 772 772 } 773 773 774 774 static PyObject *Icn_GetIconRefFromFile(PyObject *_self, PyObject *_args) 775 775 { 776 777 778 779 780 776 PyObject *_res = NULL; 777 OSErr _err; 778 FSSpec theFile; 779 IconRef theIconRef; 780 SInt16 theLabel; 781 781 #ifndef GetIconRefFromFile 782 783 #endif 784 785 786 787 788 789 790 791 792 793 794 782 PyMac_PRECHECK(GetIconRefFromFile); 783 #endif 784 if (!PyArg_ParseTuple(_args, "O&", 785 PyMac_GetFSSpec, &theFile)) 786 return NULL; 787 _err = GetIconRefFromFile(&theFile, 788 &theIconRef, 789 &theLabel); 790 if (_err != noErr) return PyMac_Error(_err); 791 _res = Py_BuildValue("O&h", 792 ResObj_New, theIconRef, 793 theLabel); 794 return _res; 795 795 } 796 796 797 797 static PyObject *Icn_GetIconRef(PyObject *_self, PyObject *_args) 798 798 { 799 800 801 802 803 804 799 PyObject *_res = NULL; 800 OSErr _err; 801 SInt16 vRefNum; 802 OSType creator; 803 OSType iconType; 804 IconRef theIconRef; 805 805 #ifndef GetIconRef 806 807 #endif 808 809 810 811 812 813 814 815 816 817 818 819 820 806 PyMac_PRECHECK(GetIconRef); 807 #endif 808 if (!PyArg_ParseTuple(_args, "hO&O&", 809 &vRefNum, 810 PyMac_GetOSType, &creator, 811 PyMac_GetOSType, &iconType)) 812 return NULL; 813 _err = GetIconRef(vRefNum, 814 creator, 815 iconType, 816 &theIconRef); 817 if (_err != noErr) return PyMac_Error(_err); 818 _res = Py_BuildValue("O&", 819 ResObj_New, theIconRef); 820 return _res; 821 821 } 822 822 823 823 static PyObject *Icn_GetIconRefFromFolder(PyObject *_self, PyObject *_args) 824 824 { 825 826 827 828 829 830 831 832 825 PyObject *_res = NULL; 826 OSErr _err; 827 SInt16 vRefNum; 828 SInt32 parentFolderID; 829 SInt32 folderID; 830 SInt8 attributes; 831 SInt8 accessPrivileges; 832 IconRef theIconRef; 833 833 #ifndef GetIconRefFromFolder 834 835 #endif 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 834 PyMac_PRECHECK(GetIconRefFromFolder); 835 #endif 836 if (!PyArg_ParseTuple(_args, "hllbb", 837 &vRefNum, 838 &parentFolderID, 839 &folderID, 840 &attributes, 841 &accessPrivileges)) 842 return NULL; 843 _err = GetIconRefFromFolder(vRefNum, 844 parentFolderID, 845 folderID, 846 attributes, 847 accessPrivileges, 848 &theIconRef); 849 if (_err != noErr) return PyMac_Error(_err); 850 _res = Py_BuildValue("O&", 851 ResObj_New, theIconRef); 852 return _res; 853 853 } 854 854 855 855 static PyObject *Icn_RegisterIconRefFromIconFamily(PyObject *_self, PyObject *_args) 856 856 { 857 858 859 860 861 862 857 PyObject *_res = NULL; 858 OSErr _err; 859 OSType creator; 860 OSType iconType; 861 IconFamilyHandle iconFamily; 862 IconRef theIconRef; 863 863 #ifndef RegisterIconRefFromIconFamily 864 865 #endif 866 867 868 869 870 871 872 873 874 875 876 877 878 864 PyMac_PRECHECK(RegisterIconRefFromIconFamily); 865 #endif 866 if (!PyArg_ParseTuple(_args, "O&O&O&", 867 PyMac_GetOSType, &creator, 868 PyMac_GetOSType, &iconType, 869 ResObj_Convert, &iconFamily)) 870 return NULL; 871 _err = RegisterIconRefFromIconFamily(creator, 872 iconType, 873 iconFamily, 874 &theIconRef); 875 if (_err != noErr) return PyMac_Error(_err); 876 _res = Py_BuildValue("O&", 877 ResObj_New, theIconRef); 878 return _res; 879 879 } 880 880 881 881 static PyObject *Icn_RegisterIconRefFromResource(PyObject *_self, PyObject *_args) 882 882 { 883 884 885 886 887 888 889 883 PyObject *_res = NULL; 884 OSErr _err; 885 OSType creator; 886 OSType iconType; 887 FSSpec resourceFile; 888 SInt16 resourceID; 889 IconRef theIconRef; 890 890 #ifndef RegisterIconRefFromResource 891 892 #endif 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 891 PyMac_PRECHECK(RegisterIconRefFromResource); 892 #endif 893 if (!PyArg_ParseTuple(_args, "O&O&O&h", 894 PyMac_GetOSType, &creator, 895 PyMac_GetOSType, &iconType, 896 PyMac_GetFSSpec, &resourceFile, 897 &resourceID)) 898 return NULL; 899 _err = RegisterIconRefFromResource(creator, 900 iconType, 901 &resourceFile, 902 resourceID, 903 &theIconRef); 904 if (_err != noErr) return PyMac_Error(_err); 905 _res = Py_BuildValue("O&", 906 ResObj_New, theIconRef); 907 return _res; 908 908 } 909 909 910 910 static PyObject *Icn_RegisterIconRefFromFSRef(PyObject *_self, PyObject *_args) 911 911 { 912 913 914 915 916 917 912 PyObject *_res = NULL; 913 OSStatus _err; 914 OSType creator; 915 OSType iconType; 916 FSRef iconFile; 917 IconRef theIconRef; 918 918 #ifndef RegisterIconRefFromFSRef 919 920 #endif 921 922 923 924 925 926 927 928 929 930 931 932 933 919 PyMac_PRECHECK(RegisterIconRefFromFSRef); 920 #endif 921 if (!PyArg_ParseTuple(_args, "O&O&O&", 922 PyMac_GetOSType, &creator, 923 PyMac_GetOSType, &iconType, 924 PyMac_GetFSRef, &iconFile)) 925 return NULL; 926 _err = RegisterIconRefFromFSRef(creator, 927 iconType, 928 &iconFile, 929 &theIconRef); 930 if (_err != noErr) return PyMac_Error(_err); 931 _res = Py_BuildValue("O&", 932 ResObj_New, theIconRef); 933 return _res; 934 934 } 935 935 936 936 static PyObject *Icn_UnregisterIconRef(PyObject *_self, PyObject *_args) 937 937 { 938 939 940 941 938 PyObject *_res = NULL; 939 OSErr _err; 940 OSType creator; 941 OSType iconType; 942 942 #ifndef UnregisterIconRef 943 944 #endif 945 946 947 948 949 950 951 952 953 954 943 PyMac_PRECHECK(UnregisterIconRef); 944 #endif 945 if (!PyArg_ParseTuple(_args, "O&O&", 946 PyMac_GetOSType, &creator, 947 PyMac_GetOSType, &iconType)) 948 return NULL; 949 _err = UnregisterIconRef(creator, 950 iconType); 951 if (_err != noErr) return PyMac_Error(_err); 952 Py_INCREF(Py_None); 953 _res = Py_None; 954 return _res; 955 955 } 956 956 957 957 static PyObject *Icn_UpdateIconRef(PyObject *_self, PyObject *_args) 958 958 { 959 960 961 959 PyObject *_res = NULL; 960 OSErr _err; 961 IconRef theIconRef; 962 962 #ifndef UpdateIconRef 963 964 #endif 965 966 967 968 969 970 971 972 963 PyMac_PRECHECK(UpdateIconRef); 964 #endif 965 if (!PyArg_ParseTuple(_args, "O&", 966 ResObj_Convert, &theIconRef)) 967 return NULL; 968 _err = UpdateIconRef(theIconRef); 969 if (_err != noErr) return PyMac_Error(_err); 970 Py_INCREF(Py_None); 971 _res = Py_None; 972 return _res; 973 973 } 974 974 975 975 static PyObject *Icn_OverrideIconRefFromResource(PyObject *_self, PyObject *_args) 976 976 { 977 978 979 980 981 977 PyObject *_res = NULL; 978 OSErr _err; 979 IconRef theIconRef; 980 FSSpec resourceFile; 981 SInt16 resourceID; 982 982 #ifndef OverrideIconRefFromResource 983 984 #endif 985 986 987 988 989 990 991 992 993 994 995 996 983 PyMac_PRECHECK(OverrideIconRefFromResource); 984 #endif 985 if (!PyArg_ParseTuple(_args, "O&O&h", 986 ResObj_Convert, &theIconRef, 987 PyMac_GetFSSpec, &resourceFile, 988 &resourceID)) 989 return NULL; 990 _err = OverrideIconRefFromResource(theIconRef, 991 &resourceFile, 992 resourceID); 993 if (_err != noErr) return PyMac_Error(_err); 994 Py_INCREF(Py_None); 995 _res = Py_None; 996 return _res; 997 997 } 998 998 999 999 static PyObject *Icn_OverrideIconRef(PyObject *_self, PyObject *_args) 1000 1000 { 1001 1002 1003 1004 1001 PyObject *_res = NULL; 1002 OSErr _err; 1003 IconRef oldIconRef; 1004 IconRef newIconRef; 1005 1005 #ifndef OverrideIconRef 1006 1007 #endif 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1006 PyMac_PRECHECK(OverrideIconRef); 1007 #endif 1008 if (!PyArg_ParseTuple(_args, "O&O&", 1009 ResObj_Convert, &oldIconRef, 1010 ResObj_Convert, &newIconRef)) 1011 return NULL; 1012 _err = OverrideIconRef(oldIconRef, 1013 newIconRef); 1014 if (_err != noErr) return PyMac_Error(_err); 1015 Py_INCREF(Py_None); 1016 _res = Py_None; 1017 return _res; 1018 1018 } 1019 1019 1020 1020 static PyObject *Icn_RemoveIconRefOverride(PyObject *_self, PyObject *_args) 1021 1021 { 1022 1023 1024 1022 PyObject *_res = NULL; 1023 OSErr _err; 1024 IconRef theIconRef; 1025 1025 #ifndef RemoveIconRefOverride 1026 1027 #endif 1028 1029 1030 1031 1032 1033 1034 1035 1026 PyMac_PRECHECK(RemoveIconRefOverride); 1027 #endif 1028 if (!PyArg_ParseTuple(_args, "O&", 1029 ResObj_Convert, &theIconRef)) 1030 return NULL; 1031 _err = RemoveIconRefOverride(theIconRef); 1032 if (_err != noErr) return PyMac_Error(_err); 1033 Py_INCREF(Py_None); 1034 _res = Py_None; 1035 return _res; 1036 1036 } 1037 1037 1038 1038 static PyObject *Icn_CompositeIconRef(PyObject *_self, PyObject *_args) 1039 1039 { 1040 1041 1042 1043 1044 1040 PyObject *_res = NULL; 1041 OSErr _err; 1042 IconRef backgroundIconRef; 1043 IconRef foregroundIconRef; 1044 IconRef compositeIconRef; 1045 1045 #ifndef CompositeIconRef 1046 1047 #endif 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1046 PyMac_PRECHECK(CompositeIconRef); 1047 #endif 1048 if (!PyArg_ParseTuple(_args, "O&O&", 1049 ResObj_Convert, &backgroundIconRef, 1050 ResObj_Convert, &foregroundIconRef)) 1051 return NULL; 1052 _err = CompositeIconRef(backgroundIconRef, 1053 foregroundIconRef, 1054 &compositeIconRef); 1055 if (_err != noErr) return PyMac_Error(_err); 1056 _res = Py_BuildValue("O&", 1057 ResObj_New, compositeIconRef); 1058 return _res; 1059 1059 } 1060 1060 1061 1061 static PyObject *Icn_IsIconRefComposite(PyObject *_self, PyObject *_args) 1062 1062 { 1063 1064 1065 1066 1067 1063 PyObject *_res = NULL; 1064 OSErr _err; 1065 IconRef compositeIconRef; 1066 IconRef backgroundIconRef; 1067 IconRef foregroundIconRef; 1068 1068 #ifndef IsIconRefComposite 1069 1070 #endif 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1069 PyMac_PRECHECK(IsIconRefComposite); 1070 #endif 1071 if (!PyArg_ParseTuple(_args, "O&", 1072 ResObj_Convert, &compositeIconRef)) 1073 return NULL; 1074 _err = IsIconRefComposite(compositeIconRef, 1075 &backgroundIconRef, 1076 &foregroundIconRef); 1077 if (_err != noErr) return PyMac_Error(_err); 1078 _res = Py_BuildValue("O&O&", 1079 ResObj_New, backgroundIconRef, 1080 ResObj_New, foregroundIconRef); 1081 return _res; 1082 1082 } 1083 1083 1084 1084 static PyObject *Icn_IsValidIconRef(PyObject *_self, PyObject *_args) 1085 1085 { 1086 1087 1088 1086 PyObject *_res = NULL; 1087 Boolean _rv; 1088 IconRef theIconRef; 1089 1089 #ifndef IsValidIconRef 1090 1091 #endif 1092 1093 1094 1095 1096 1097 1098 1090 PyMac_PRECHECK(IsValidIconRef); 1091 #endif 1092 if (!PyArg_ParseTuple(_args, "O&", 1093 ResObj_Convert, &theIconRef)) 1094 return NULL; 1095 _rv = IsValidIconRef(theIconRef); 1096 _res = Py_BuildValue("b", 1097 _rv); 1098 return _res; 1099 1099 } 1100 1100 1101 1101 static PyObject *Icn_PlotIconRef(PyObject *_self, PyObject *_args) 1102 1102 { 1103 1104 1105 1106 1107 1108 1109 1103 PyObject *_res = NULL; 1104 OSErr _err; 1105 Rect theRect; 1106 IconAlignmentType align; 1107 IconTransformType transform; 1108 IconServicesUsageFlags theIconServicesUsageFlags; 1109 IconRef theIconRef; 1110 1110 #ifndef PlotIconRef 1111 1112 #endif 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1111 PyMac_PRECHECK(PlotIconRef); 1112 #endif 1113 if (!PyArg_ParseTuple(_args, "O&hhlO&", 1114 PyMac_GetRect, &theRect, 1115 &align, 1116 &transform, 1117 &theIconServicesUsageFlags, 1118 ResObj_Convert, &theIconRef)) 1119 return NULL; 1120 _err = PlotIconRef(&theRect, 1121 align, 1122 transform, 1123 theIconServicesUsageFlags, 1124 theIconRef); 1125 if (_err != noErr) return PyMac_Error(_err); 1126 Py_INCREF(Py_None); 1127 _res = Py_None; 1128 return _res; 1129 1129 } 1130 1130 1131 1131 static PyObject *Icn_PtInIconRef(PyObject *_self, PyObject *_args) 1132 1132 { 1133 1134 1135 1136 1137 1138 1139 1133 PyObject *_res = NULL; 1134 Boolean _rv; 1135 Point testPt; 1136 Rect iconRect; 1137 IconAlignmentType align; 1138 IconServicesUsageFlags theIconServicesUsageFlags; 1139 IconRef theIconRef; 1140 1140 #ifndef PtInIconRef 1141 1142 #endif 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1141 PyMac_PRECHECK(PtInIconRef); 1142 #endif 1143 if (!PyArg_ParseTuple(_args, "O&O&hlO&", 1144 PyMac_GetPoint, &testPt, 1145 PyMac_GetRect, &iconRect, 1146 &align, 1147 &theIconServicesUsageFlags, 1148 ResObj_Convert, &theIconRef)) 1149 return NULL; 1150 _rv = PtInIconRef(&testPt, 1151 &iconRect, 1152 align, 1153 theIconServicesUsageFlags, 1154 theIconRef); 1155 _res = Py_BuildValue("b", 1156 _rv); 1157 return _res; 1158 1158 } 1159 1159 1160 1160 static PyObject *Icn_RectInIconRef(PyObject *_self, PyObject *_args) 1161 1161 { 1162 1163 1164 1165 1166 1167 1168 1162 PyObject *_res = NULL; 1163 Boolean _rv; 1164 Rect testRect; 1165 Rect iconRect; 1166 IconAlignmentType align; 1167 IconServicesUsageFlags iconServicesUsageFlags; 1168 IconRef theIconRef; 1169 1169 #ifndef RectInIconRef 1170 1171 #endif 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1170 PyMac_PRECHECK(RectInIconRef); 1171 #endif 1172 if (!PyArg_ParseTuple(_args, "O&O&hlO&", 1173 PyMac_GetRect, &testRect, 1174 PyMac_GetRect, &iconRect, 1175 &align, 1176 &iconServicesUsageFlags, 1177 ResObj_Convert, &theIconRef)) 1178 return NULL; 1179 _rv = RectInIconRef(&testRect, 1180 &iconRect, 1181 align, 1182 iconServicesUsageFlags, 1183 theIconRef); 1184 _res = Py_BuildValue("b", 1185 _rv); 1186 return _res; 1187 1187 } 1188 1188 1189 1189 static PyObject *Icn_IconRefToRgn(PyObject *_self, PyObject *_args) 1190 1190 { 1191 1192 1193 1194 1195 1196 1197 1191 PyObject *_res = NULL; 1192 OSErr _err; 1193 RgnHandle theRgn; 1194 Rect iconRect; 1195 IconAlignmentType align; 1196 IconServicesUsageFlags iconServicesUsageFlags; 1197 IconRef theIconRef; 1198 1198 #ifndef IconRefToRgn 1199 1200 #endif 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1199 PyMac_PRECHECK(IconRefToRgn); 1200 #endif 1201 if (!PyArg_ParseTuple(_args, "O&O&hlO&", 1202 ResObj_Convert, &theRgn, 1203 PyMac_GetRect, &iconRect, 1204 &align, 1205 &iconServicesUsageFlags, 1206 ResObj_Convert, &theIconRef)) 1207 return NULL; 1208 _err = IconRefToRgn(theRgn, 1209 &iconRect, 1210 align, 1211 iconServicesUsageFlags, 1212 theIconRef); 1213 if (_err != noErr) return PyMac_Error(_err); 1214 Py_INCREF(Py_None); 1215 _res = Py_None; 1216 return _res; 1217 1217 } 1218 1218 1219 1219 static PyObject *Icn_GetIconSizesFromIconRef(PyObject *_self, PyObject *_args) 1220 1220 { 1221 1222 1223 1224 1225 1226 1221 PyObject *_res = NULL; 1222 OSErr _err; 1223 IconSelectorValue iconSelectorInput; 1224 IconSelectorValue iconSelectorOutputPtr; 1225 IconServicesUsageFlags iconServicesUsageFlags; 1226 IconRef theIconRef; 1227 1227 #ifndef GetIconSizesFromIconRef 1228 1229 #endif 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1228 PyMac_PRECHECK(GetIconSizesFromIconRef); 1229 #endif 1230 if (!PyArg_ParseTuple(_args, "llO&", 1231 &iconSelectorInput, 1232 &iconServicesUsageFlags, 1233 ResObj_Convert, &theIconRef)) 1234 return NULL; 1235 _err = GetIconSizesFromIconRef(iconSelectorInput, 1236 &iconSelectorOutputPtr, 1237 iconServicesUsageFlags, 1238 theIconRef); 1239 if (_err != noErr) return PyMac_Error(_err); 1240 _res = Py_BuildValue("l", 1241 iconSelectorOutputPtr); 1242 return _res; 1243 1243 } 1244 1244 1245 1245 static PyObject *Icn_FlushIconRefs(PyObject *_self, PyObject *_args) 1246 1246 { 1247 1248 1249 1250 1247 PyObject *_res = NULL; 1248 OSErr _err; 1249 OSType creator; 1250 OSType iconType; 1251 1251 #ifndef FlushIconRefs 1252 1253 #endif 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1252 PyMac_PRECHECK(FlushIconRefs); 1253 #endif 1254 if (!PyArg_ParseTuple(_args, "O&O&", 1255 PyMac_GetOSType, &creator, 1256 PyMac_GetOSType, &iconType)) 1257 return NULL; 1258 _err = FlushIconRefs(creator, 1259 iconType); 1260 if (_err != noErr) return PyMac_Error(_err); 1261 Py_INCREF(Py_None); 1262 _res = Py_None; 1263 return _res; 1264 1264 } 1265 1265 1266 1266 static PyObject *Icn_FlushIconRefsByVolume(PyObject *_self, PyObject *_args) 1267 1267 { 1268 1269 1270 1268 PyObject *_res = NULL; 1269 OSErr _err; 1270 SInt16 vRefNum; 1271 1271 #ifndef FlushIconRefsByVolume 1272 1273 #endif 1274 1275 1276 1277 1278 1279 1280 1281 1272 PyMac_PRECHECK(FlushIconRefsByVolume); 1273 #endif 1274 if (!PyArg_ParseTuple(_args, "h", 1275 &vRefNum)) 1276 return NULL; 1277 _err = FlushIconRefsByVolume(vRefNum); 1278 if (_err != noErr) return PyMac_Error(_err); 1279 Py_INCREF(Py_None); 1280 _res = Py_None; 1281 return _res; 1282 1282 } 1283 1283 1284 1284 static PyObject *Icn_SetCustomIconsEnabled(PyObject *_self, PyObject *_args) 1285 1285 { 1286 1287 1288 1289 1286 PyObject *_res = NULL; 1287 OSErr _err; 1288 SInt16 vRefNum; 1289 Boolean enableCustomIcons; 1290 1290 #ifndef SetCustomIconsEnabled 1291 1292 #endif 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1291 PyMac_PRECHECK(SetCustomIconsEnabled); 1292 #endif 1293 if (!PyArg_ParseTuple(_args, "hb", 1294 &vRefNum, 1295 &enableCustomIcons)) 1296 return NULL; 1297 _err = SetCustomIconsEnabled(vRefNum, 1298 enableCustomIcons); 1299 if (_err != noErr) return PyMac_Error(_err); 1300 Py_INCREF(Py_None); 1301 _res = Py_None; 1302 return _res; 1303 1303 } 1304 1304 1305 1305 static PyObject *Icn_GetCustomIconsEnabled(PyObject *_self, PyObject *_args) 1306 1306 { 1307 1308 1309 1310 1307 PyObject *_res = NULL; 1308 OSErr _err; 1309 SInt16 vRefNum; 1310 Boolean customIconsEnabled; 1311 1311 #ifndef GetCustomIconsEnabled 1312 1313 #endif 1314 1315 1316 1317 1318 1319 1320 1321 1322 1312 PyMac_PRECHECK(GetCustomIconsEnabled); 1313 #endif 1314 if (!PyArg_ParseTuple(_args, "h", 1315 &vRefNum)) 1316 return NULL; 1317 _err = GetCustomIconsEnabled(vRefNum, 1318 &customIconsEnabled); 1319 if (_err != noErr) return PyMac_Error(_err); 1320 _res = Py_BuildValue("b", 1321 customIconsEnabled); 1322 return _res; 1323 1323 } 1324 1324 1325 1325 static PyObject *Icn_IsIconRefMaskEmpty(PyObject *_self, PyObject *_args) 1326 1326 { 1327 1328 1329 1327 PyObject *_res = NULL; 1328 Boolean _rv; 1329 IconRef iconRef; 1330 1330 #ifndef IsIconRefMaskEmpty 1331 1332 #endif 1333 1334 1335 1336 1337 1338 1339 1331 PyMac_PRECHECK(IsIconRefMaskEmpty); 1332 #endif 1333 if (!PyArg_ParseTuple(_args, "O&", 1334 ResObj_Convert, &iconRef)) 1335 return NULL; 1336 _rv = IsIconRefMaskEmpty(iconRef); 1337 _res = Py_BuildValue("b", 1338 _rv); 1339 return _res; 1340 1340 } 1341 1341 1342 1342 static PyObject *Icn_GetIconRefVariant(PyObject *_self, PyObject *_args) 1343 1343 { 1344 1345 1346 1347 1348 1344 PyObject *_res = NULL; 1345 IconRef _rv; 1346 IconRef inIconRef; 1347 OSType inVariant; 1348 IconTransformType outTransform; 1349 1349 #ifndef GetIconRefVariant 1350 1351 #endif 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1350 PyMac_PRECHECK(GetIconRefVariant); 1351 #endif 1352 if (!PyArg_ParseTuple(_args, "O&O&", 1353 ResObj_Convert, &inIconRef, 1354 PyMac_GetOSType, &inVariant)) 1355 return NULL; 1356 _rv = GetIconRefVariant(inIconRef, 1357 inVariant, 1358 &outTransform); 1359 _res = Py_BuildValue("O&h", 1360 ResObj_New, _rv, 1361 outTransform); 1362 return _res; 1363 1363 } 1364 1364 1365 1365 static PyObject *Icn_RegisterIconRefFromIconFile(PyObject *_self, PyObject *_args) 1366 1366 { 1367 1368 1369 1370 1371 1372 1367 PyObject *_res = NULL; 1368 OSErr _err; 1369 OSType creator; 1370 OSType iconType; 1371 FSSpec iconFile; 1372 IconRef theIconRef; 1373 1373 #ifndef RegisterIconRefFromIconFile 1374 1375 #endif 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1374 PyMac_PRECHECK(RegisterIconRefFromIconFile); 1375 #endif 1376 if (!PyArg_ParseTuple(_args, "O&O&O&", 1377 PyMac_GetOSType, &creator, 1378 PyMac_GetOSType, &iconType, 1379 PyMac_GetFSSpec, &iconFile)) 1380 return NULL; 1381 _err = RegisterIconRefFromIconFile(creator, 1382 iconType, 1383 &iconFile, 1384 &theIconRef); 1385 if (_err != noErr) return PyMac_Error(_err); 1386 _res = Py_BuildValue("O&", 1387 ResObj_New, theIconRef); 1388 return _res; 1389 1389 } 1390 1390 1391 1391 static PyObject *Icn_ReadIconFile(PyObject *_self, PyObject *_args) 1392 1392 { 1393 1394 1395 1396 1393 PyObject *_res = NULL; 1394 OSErr _err; 1395 FSSpec iconFile; 1396 IconFamilyHandle iconFamily; 1397 1397 #ifndef ReadIconFile 1398 1399 #endif 1400 1401 1402 1403 1404 1405 1406 1407 1408 1398 PyMac_PRECHECK(ReadIconFile); 1399 #endif 1400 if (!PyArg_ParseTuple(_args, "O&", 1401 PyMac_GetFSSpec, &iconFile)) 1402 return NULL; 1403 _err = ReadIconFile(&iconFile, 1404 &iconFamily); 1405 if (_err != noErr) return PyMac_Error(_err); 1406 _res = Py_BuildValue("O&", 1407 ResObj_New, iconFamily); 1408 return _res; 1409 1409 } 1410 1410 1411 1411 static PyObject *Icn_ReadIconFromFSRef(PyObject *_self, PyObject *_args) 1412 1412 { 1413 1414 1415 1416 1413 PyObject *_res = NULL; 1414 OSStatus _err; 1415 FSRef ref; 1416 IconFamilyHandle iconFamily; 1417 1417 #ifndef ReadIconFromFSRef 1418 1419 #endif 1420 1421 1422 1423 1424 1425 1426 1427 1428 1418 PyMac_PRECHECK(ReadIconFromFSRef); 1419 #endif 1420 if (!PyArg_ParseTuple(_args, "O&", 1421 PyMac_GetFSRef, &ref)) 1422 return NULL; 1423 _err = ReadIconFromFSRef(&ref, 1424 &iconFamily); 1425 if (_err != noErr) return PyMac_Error(_err); 1426 _res = Py_BuildValue("O&", 1427 ResObj_New, iconFamily); 1428 return _res; 1429 1429 } 1430 1430 1431 1431 static PyObject *Icn_WriteIconFile(PyObject *_self, PyObject *_args) 1432 1432 { 1433 1434 1435 1436 1433 PyObject *_res = NULL; 1434 OSErr _err; 1435 IconFamilyHandle iconFamily; 1436 FSSpec iconFile; 1437 1437 #ifndef WriteIconFile 1438 1439 #endif 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1438 PyMac_PRECHECK(WriteIconFile); 1439 #endif 1440 if (!PyArg_ParseTuple(_args, "O&O&", 1441 ResObj_Convert, &iconFamily, 1442 PyMac_GetFSSpec, &iconFile)) 1443 return NULL; 1444 _err = WriteIconFile(iconFamily, 1445 &iconFile); 1446 if (_err != noErr) return PyMac_Error(_err); 1447 Py_INCREF(Py_None); 1448 _res = Py_None; 1449 return _res; 1450 1450 } 1451 1451 #endif /* __LP64__ */ … … 1453 1453 static PyMethodDef Icn_methods[] = { 1454 1454 #ifndef __LP64__ 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1455 {"GetCIcon", (PyCFunction)Icn_GetCIcon, 1, 1456 PyDoc_STR("(SInt16 iconID) -> (CIconHandle _rv)")}, 1457 {"PlotCIcon", (PyCFunction)Icn_PlotCIcon, 1, 1458 PyDoc_STR("(Rect theRect, CIconHandle theIcon) -> None")}, 1459 {"DisposeCIcon", (PyCFunction)Icn_DisposeCIcon, 1, 1460 PyDoc_STR("(CIconHandle theIcon) -> None")}, 1461 {"GetIcon", (PyCFunction)Icn_GetIcon, 1, 1462 PyDoc_STR("(SInt16 iconID) -> (Handle _rv)")}, 1463 {"PlotIcon", (PyCFunction)Icn_PlotIcon, 1, 1464 PyDoc_STR("(Rect theRect, Handle theIcon) -> None")}, 1465 {"PlotIconID", (PyCFunction)Icn_PlotIconID, 1, 1466 PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, SInt16 theResID) -> None")}, 1467 {"NewIconSuite", (PyCFunction)Icn_NewIconSuite, 1, 1468 PyDoc_STR("() -> (IconSuiteRef theIconSuite)")}, 1469 {"AddIconToSuite", (PyCFunction)Icn_AddIconToSuite, 1, 1470 PyDoc_STR("(Handle theIconData, IconSuiteRef theSuite, ResType theType) -> None")}, 1471 {"GetIconFromSuite", (PyCFunction)Icn_GetIconFromSuite, 1, 1472 PyDoc_STR("(IconSuiteRef theSuite, ResType theType) -> (Handle theIconData)")}, 1473 {"GetIconSuite", (PyCFunction)Icn_GetIconSuite, 1, 1474 PyDoc_STR("(SInt16 theResID, IconSelectorValue selector) -> (IconSuiteRef theIconSuite)")}, 1475 {"DisposeIconSuite", (PyCFunction)Icn_DisposeIconSuite, 1, 1476 PyDoc_STR("(IconSuiteRef theIconSuite, Boolean disposeData) -> None")}, 1477 {"PlotIconSuite", (PyCFunction)Icn_PlotIconSuite, 1, 1478 PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, IconSuiteRef theIconSuite) -> None")}, 1479 {"LoadIconCache", (PyCFunction)Icn_LoadIconCache, 1, 1480 PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, IconCacheRef theIconCache) -> None")}, 1481 {"GetLabel", (PyCFunction)Icn_GetLabel, 1, 1482 PyDoc_STR("(SInt16 labelNumber, Str255 labelString) -> (RGBColor labelColor)")}, 1483 {"PtInIconID", (PyCFunction)Icn_PtInIconID, 1, 1484 PyDoc_STR("(Point testPt, Rect iconRect, IconAlignmentType align, SInt16 iconID) -> (Boolean _rv)")}, 1485 {"PtInIconSuite", (PyCFunction)Icn_PtInIconSuite, 1, 1486 PyDoc_STR("(Point testPt, Rect iconRect, IconAlignmentType align, IconSuiteRef theIconSuite) -> (Boolean _rv)")}, 1487 {"RectInIconID", (PyCFunction)Icn_RectInIconID, 1, 1488 PyDoc_STR("(Rect testRect, Rect iconRect, IconAlignmentType align, SInt16 iconID) -> (Boolean _rv)")}, 1489 {"RectInIconSuite", (PyCFunction)Icn_RectInIconSuite, 1, 1490 PyDoc_STR("(Rect testRect, Rect iconRect, IconAlignmentType align, IconSuiteRef theIconSuite) -> (Boolean _rv)")}, 1491 {"IconIDToRgn", (PyCFunction)Icn_IconIDToRgn, 1, 1492 PyDoc_STR("(RgnHandle theRgn, Rect iconRect, IconAlignmentType align, SInt16 iconID) -> None")}, 1493 {"IconSuiteToRgn", (PyCFunction)Icn_IconSuiteToRgn, 1, 1494 PyDoc_STR("(RgnHandle theRgn, Rect iconRect, IconAlignmentType align, IconSuiteRef theIconSuite) -> None")}, 1495 {"SetSuiteLabel", (PyCFunction)Icn_SetSuiteLabel, 1, 1496 PyDoc_STR("(IconSuiteRef theSuite, SInt16 theLabel) -> None")}, 1497 {"GetSuiteLabel", (PyCFunction)Icn_GetSuiteLabel, 1, 1498 PyDoc_STR("(IconSuiteRef theSuite) -> (SInt16 _rv)")}, 1499 {"PlotIconHandle", (PyCFunction)Icn_PlotIconHandle, 1, 1500 PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, Handle theIcon) -> None")}, 1501 {"PlotSICNHandle", (PyCFunction)Icn_PlotSICNHandle, 1, 1502 PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN) -> None")}, 1503 {"PlotCIconHandle", (PyCFunction)Icn_PlotCIconHandle, 1, 1504 PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon) -> None")}, 1505 {"IconRefToIconFamily", (PyCFunction)Icn_IconRefToIconFamily, 1, 1506 PyDoc_STR("(IconRef theIconRef, IconSelectorValue whichIcons) -> (IconFamilyHandle iconFamily)")}, 1507 {"IconFamilyToIconSuite", (PyCFunction)Icn_IconFamilyToIconSuite, 1, 1508 PyDoc_STR("(IconFamilyHandle iconFamily, IconSelectorValue whichIcons) -> (IconSuiteRef iconSuite)")}, 1509 {"IconSuiteToIconFamily", (PyCFunction)Icn_IconSuiteToIconFamily, 1, 1510 PyDoc_STR("(IconSuiteRef iconSuite, IconSelectorValue whichIcons) -> (IconFamilyHandle iconFamily)")}, 1511 {"SetIconFamilyData", (PyCFunction)Icn_SetIconFamilyData, 1, 1512 PyDoc_STR("(IconFamilyHandle iconFamily, OSType iconType, Handle h) -> None")}, 1513 {"GetIconFamilyData", (PyCFunction)Icn_GetIconFamilyData, 1, 1514 PyDoc_STR("(IconFamilyHandle iconFamily, OSType iconType, Handle h) -> None")}, 1515 {"GetIconRefOwners", (PyCFunction)Icn_GetIconRefOwners, 1, 1516 PyDoc_STR("(IconRef theIconRef) -> (UInt16 owners)")}, 1517 {"AcquireIconRef", (PyCFunction)Icn_AcquireIconRef, 1, 1518 PyDoc_STR("(IconRef theIconRef) -> None")}, 1519 {"ReleaseIconRef", (PyCFunction)Icn_ReleaseIconRef, 1, 1520 PyDoc_STR("(IconRef theIconRef) -> None")}, 1521 {"GetIconRefFromFile", (PyCFunction)Icn_GetIconRefFromFile, 1, 1522 PyDoc_STR("(FSSpec theFile) -> (IconRef theIconRef, SInt16 theLabel)")}, 1523 {"GetIconRef", (PyCFunction)Icn_GetIconRef, 1, 1524 PyDoc_STR("(SInt16 vRefNum, OSType creator, OSType iconType) -> (IconRef theIconRef)")}, 1525 {"GetIconRefFromFolder", (PyCFunction)Icn_GetIconRefFromFolder, 1, 1526 PyDoc_STR("(SInt16 vRefNum, SInt32 parentFolderID, SInt32 folderID, SInt8 attributes, SInt8 accessPrivileges) -> (IconRef theIconRef)")}, 1527 {"RegisterIconRefFromIconFamily", (PyCFunction)Icn_RegisterIconRefFromIconFamily, 1, 1528 PyDoc_STR("(OSType creator, OSType iconType, IconFamilyHandle iconFamily) -> (IconRef theIconRef)")}, 1529 {"RegisterIconRefFromResource", (PyCFunction)Icn_RegisterIconRefFromResource, 1, 1530 PyDoc_STR("(OSType creator, OSType iconType, FSSpec resourceFile, SInt16 resourceID) -> (IconRef theIconRef)")}, 1531 {"RegisterIconRefFromFSRef", (PyCFunction)Icn_RegisterIconRefFromFSRef, 1, 1532 PyDoc_STR("(OSType creator, OSType iconType, FSRef iconFile) -> (IconRef theIconRef)")}, 1533 {"UnregisterIconRef", (PyCFunction)Icn_UnregisterIconRef, 1, 1534 PyDoc_STR("(OSType creator, OSType iconType) -> None")}, 1535 {"UpdateIconRef", (PyCFunction)Icn_UpdateIconRef, 1, 1536 PyDoc_STR("(IconRef theIconRef) -> None")}, 1537 {"OverrideIconRefFromResource", (PyCFunction)Icn_OverrideIconRefFromResource, 1, 1538 PyDoc_STR("(IconRef theIconRef, FSSpec resourceFile, SInt16 resourceID) -> None")}, 1539 {"OverrideIconRef", (PyCFunction)Icn_OverrideIconRef, 1, 1540 PyDoc_STR("(IconRef oldIconRef, IconRef newIconRef) -> None")}, 1541 {"RemoveIconRefOverride", (PyCFunction)Icn_RemoveIconRefOverride, 1, 1542 PyDoc_STR("(IconRef theIconRef) -> None")}, 1543 {"CompositeIconRef", (PyCFunction)Icn_CompositeIconRef, 1, 1544 PyDoc_STR("(IconRef backgroundIconRef, IconRef foregroundIconRef) -> (IconRef compositeIconRef)")}, 1545 {"IsIconRefComposite", (PyCFunction)Icn_IsIconRefComposite, 1, 1546 PyDoc_STR("(IconRef compositeIconRef) -> (IconRef backgroundIconRef, IconRef foregroundIconRef)")}, 1547 {"IsValidIconRef", (PyCFunction)Icn_IsValidIconRef, 1, 1548 PyDoc_STR("(IconRef theIconRef) -> (Boolean _rv)")}, 1549 {"PlotIconRef", (PyCFunction)Icn_PlotIconRef, 1, 1550 PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef) -> None")}, 1551 {"PtInIconRef", (PyCFunction)Icn_PtInIconRef, 1, 1552 PyDoc_STR("(Point testPt, Rect iconRect, IconAlignmentType align, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef) -> (Boolean _rv)")}, 1553 {"RectInIconRef", (PyCFunction)Icn_RectInIconRef, 1, 1554 PyDoc_STR("(Rect testRect, Rect iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef) -> (Boolean _rv)")}, 1555 {"IconRefToRgn", (PyCFunction)Icn_IconRefToRgn, 1, 1556 PyDoc_STR("(RgnHandle theRgn, Rect iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef) -> None")}, 1557 {"GetIconSizesFromIconRef", (PyCFunction)Icn_GetIconSizesFromIconRef, 1, 1558 PyDoc_STR("(IconSelectorValue iconSelectorInput, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef) -> (IconSelectorValue iconSelectorOutputPtr)")}, 1559 {"FlushIconRefs", (PyCFunction)Icn_FlushIconRefs, 1, 1560 PyDoc_STR("(OSType creator, OSType iconType) -> None")}, 1561 {"FlushIconRefsByVolume", (PyCFunction)Icn_FlushIconRefsByVolume, 1, 1562 PyDoc_STR("(SInt16 vRefNum) -> None")}, 1563 {"SetCustomIconsEnabled", (PyCFunction)Icn_SetCustomIconsEnabled, 1, 1564 PyDoc_STR("(SInt16 vRefNum, Boolean enableCustomIcons) -> None")}, 1565 {"GetCustomIconsEnabled", (PyCFunction)Icn_GetCustomIconsEnabled, 1, 1566 PyDoc_STR("(SInt16 vRefNum) -> (Boolean customIconsEnabled)")}, 1567 {"IsIconRefMaskEmpty", (PyCFunction)Icn_IsIconRefMaskEmpty, 1, 1568 PyDoc_STR("(IconRef iconRef) -> (Boolean _rv)")}, 1569 {"GetIconRefVariant", (PyCFunction)Icn_GetIconRefVariant, 1, 1570 PyDoc_STR("(IconRef inIconRef, OSType inVariant) -> (IconRef _rv, IconTransformType outTransform)")}, 1571 {"RegisterIconRefFromIconFile", (PyCFunction)Icn_RegisterIconRefFromIconFile, 1, 1572 PyDoc_STR("(OSType creator, OSType iconType, FSSpec iconFile) -> (IconRef theIconRef)")}, 1573 {"ReadIconFile", (PyCFunction)Icn_ReadIconFile, 1, 1574 PyDoc_STR("(FSSpec iconFile) -> (IconFamilyHandle iconFamily)")}, 1575 {"ReadIconFromFSRef", (PyCFunction)Icn_ReadIconFromFSRef, 1, 1576 PyDoc_STR("(FSRef ref) -> (IconFamilyHandle iconFamily)")}, 1577 {"WriteIconFile", (PyCFunction)Icn_WriteIconFile, 1, 1578 PyDoc_STR("(IconFamilyHandle iconFamily, FSSpec iconFile) -> None")}, 1579 1579 #endif /* __LP64__ */ 1580 1580 {NULL, NULL, 0} 1581 1581 }; 1582 1582 … … 1586 1586 void init_Icn(void) 1587 1587 { 1588 1588 PyObject *m; 1589 1589 #ifndef __LP64__ 1590 1590 PyObject *d; 1591 1591 #endif /* __LP64__ */ 1592 1592 … … 1594 1594 1595 1595 1596 1596 m = Py_InitModule("_Icn", Icn_methods); 1597 1597 #ifndef __LP64__ 1598 1599 1600 1601 1602 1598 d = PyModule_GetDict(m); 1599 Icn_Error = PyMac_GetOSErrException(); 1600 if (Icn_Error == NULL || 1601 PyDict_SetItemString(d, "Error", Icn_Error) != 0) 1602 return; 1603 1603 #endif /* __LP64__ */ 1604 1604 }
Note:
See TracChangeset
for help on using the changeset viewer.