2 /* ========================== Module _Icn =========================== */
9 #include "pywintoolbox.h"
12 #include "pymactoolbox.h"
15 /* Macro to test whether a weak-loaded CFM function exists */
16 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
17 PyErr_SetString(PyExc_NotImplementedError, \
18 "Not available in this shared library/OS version"); \
23 #ifdef WITHOUT_FRAMEWORKS
26 #include <Carbon/Carbon.h>
30 static PyObject
*Icn_Error
;
32 static PyObject
*Icn_GetCIcon(PyObject
*_self
, PyObject
*_args
)
34 PyObject
*_res
= NULL
;
38 PyMac_PRECHECK(GetCIcon
);
40 if (!PyArg_ParseTuple(_args
, "h",
43 _rv
= GetCIcon(iconID
);
44 _res
= Py_BuildValue("O&",
49 static PyObject
*Icn_PlotCIcon(PyObject
*_self
, PyObject
*_args
)
51 PyObject
*_res
= NULL
;
55 PyMac_PRECHECK(PlotCIcon
);
57 if (!PyArg_ParseTuple(_args
, "O&O&",
58 PyMac_GetRect
, &theRect
,
59 ResObj_Convert
, &theIcon
))
68 static PyObject
*Icn_DisposeCIcon(PyObject
*_self
, PyObject
*_args
)
70 PyObject
*_res
= NULL
;
73 PyMac_PRECHECK(DisposeCIcon
);
75 if (!PyArg_ParseTuple(_args
, "O&",
76 ResObj_Convert
, &theIcon
))
78 DisposeCIcon(theIcon
);
84 static PyObject
*Icn_GetIcon(PyObject
*_self
, PyObject
*_args
)
86 PyObject
*_res
= NULL
;
90 PyMac_PRECHECK(GetIcon
);
92 if (!PyArg_ParseTuple(_args
, "h",
95 _rv
= GetIcon(iconID
);
96 _res
= Py_BuildValue("O&",
101 static PyObject
*Icn_PlotIcon(PyObject
*_self
, PyObject
*_args
)
103 PyObject
*_res
= NULL
;
107 PyMac_PRECHECK(PlotIcon
);
109 if (!PyArg_ParseTuple(_args
, "O&O&",
110 PyMac_GetRect
, &theRect
,
111 ResObj_Convert
, &theIcon
))
120 static PyObject
*Icn_PlotIconID(PyObject
*_self
, PyObject
*_args
)
122 PyObject
*_res
= NULL
;
125 IconAlignmentType align
;
126 IconTransformType transform
;
129 PyMac_PRECHECK(PlotIconID
);
131 if (!PyArg_ParseTuple(_args
, "O&hhh",
132 PyMac_GetRect
, &theRect
,
137 _err
= PlotIconID(&theRect
,
141 if (_err
!= noErr
) return PyMac_Error(_err
);
147 static PyObject
*Icn_NewIconSuite(PyObject
*_self
, PyObject
*_args
)
149 PyObject
*_res
= NULL
;
151 IconSuiteRef theIconSuite
;
153 PyMac_PRECHECK(NewIconSuite
);
155 if (!PyArg_ParseTuple(_args
, ""))
157 _err
= NewIconSuite(&theIconSuite
);
158 if (_err
!= noErr
) return PyMac_Error(_err
);
159 _res
= Py_BuildValue("O&",
160 ResObj_New
, theIconSuite
);
164 static PyObject
*Icn_AddIconToSuite(PyObject
*_self
, PyObject
*_args
)
166 PyObject
*_res
= NULL
;
169 IconSuiteRef theSuite
;
171 #ifndef AddIconToSuite
172 PyMac_PRECHECK(AddIconToSuite
);
174 if (!PyArg_ParseTuple(_args
, "O&O&O&",
175 ResObj_Convert
, &theIconData
,
176 ResObj_Convert
, &theSuite
,
177 PyMac_GetOSType
, &theType
))
179 _err
= AddIconToSuite(theIconData
,
182 if (_err
!= noErr
) return PyMac_Error(_err
);
188 static PyObject
*Icn_GetIconFromSuite(PyObject
*_self
, PyObject
*_args
)
190 PyObject
*_res
= NULL
;
193 IconSuiteRef theSuite
;
195 #ifndef GetIconFromSuite
196 PyMac_PRECHECK(GetIconFromSuite
);
198 if (!PyArg_ParseTuple(_args
, "O&O&",
199 ResObj_Convert
, &theSuite
,
200 PyMac_GetOSType
, &theType
))
202 _err
= GetIconFromSuite(&theIconData
,
205 if (_err
!= noErr
) return PyMac_Error(_err
);
206 _res
= Py_BuildValue("O&",
207 ResObj_New
, theIconData
);
211 static PyObject
*Icn_GetIconSuite(PyObject
*_self
, PyObject
*_args
)
213 PyObject
*_res
= NULL
;
215 IconSuiteRef theIconSuite
;
217 IconSelectorValue selector
;
219 PyMac_PRECHECK(GetIconSuite
);
221 if (!PyArg_ParseTuple(_args
, "hl",
225 _err
= GetIconSuite(&theIconSuite
,
228 if (_err
!= noErr
) return PyMac_Error(_err
);
229 _res
= Py_BuildValue("O&",
230 ResObj_New
, theIconSuite
);
234 static PyObject
*Icn_DisposeIconSuite(PyObject
*_self
, PyObject
*_args
)
236 PyObject
*_res
= NULL
;
238 IconSuiteRef theIconSuite
;
240 #ifndef DisposeIconSuite
241 PyMac_PRECHECK(DisposeIconSuite
);
243 if (!PyArg_ParseTuple(_args
, "O&b",
244 ResObj_Convert
, &theIconSuite
,
247 _err
= DisposeIconSuite(theIconSuite
,
249 if (_err
!= noErr
) return PyMac_Error(_err
);
255 static PyObject
*Icn_PlotIconSuite(PyObject
*_self
, PyObject
*_args
)
257 PyObject
*_res
= NULL
;
260 IconAlignmentType align
;
261 IconTransformType transform
;
262 IconSuiteRef theIconSuite
;
263 #ifndef PlotIconSuite
264 PyMac_PRECHECK(PlotIconSuite
);
266 if (!PyArg_ParseTuple(_args
, "O&hhO&",
267 PyMac_GetRect
, &theRect
,
270 ResObj_Convert
, &theIconSuite
))
272 _err
= PlotIconSuite(&theRect
,
276 if (_err
!= noErr
) return PyMac_Error(_err
);
282 static PyObject
*Icn_LoadIconCache(PyObject
*_self
, PyObject
*_args
)
284 PyObject
*_res
= NULL
;
287 IconAlignmentType align
;
288 IconTransformType transform
;
289 IconCacheRef theIconCache
;
290 #ifndef LoadIconCache
291 PyMac_PRECHECK(LoadIconCache
);
293 if (!PyArg_ParseTuple(_args
, "O&hhO&",
294 PyMac_GetRect
, &theRect
,
297 ResObj_Convert
, &theIconCache
))
299 _err
= LoadIconCache(&theRect
,
303 if (_err
!= noErr
) return PyMac_Error(_err
);
309 static PyObject
*Icn_GetLabel(PyObject
*_self
, PyObject
*_args
)
311 PyObject
*_res
= NULL
;
317 PyMac_PRECHECK(GetLabel
);
319 if (!PyArg_ParseTuple(_args
, "hO&",
321 PyMac_GetStr255
, labelString
))
323 _err
= GetLabel(labelNumber
,
326 if (_err
!= noErr
) return PyMac_Error(_err
);
327 _res
= Py_BuildValue("O&",
328 QdRGB_New
, &labelColor
);
332 static PyObject
*Icn_PtInIconID(PyObject
*_self
, PyObject
*_args
)
334 PyObject
*_res
= NULL
;
338 IconAlignmentType align
;
341 PyMac_PRECHECK(PtInIconID
);
343 if (!PyArg_ParseTuple(_args
, "O&O&hh",
344 PyMac_GetPoint
, &testPt
,
345 PyMac_GetRect
, &iconRect
,
349 _rv
= PtInIconID(testPt
,
353 _res
= Py_BuildValue("b",
358 static PyObject
*Icn_PtInIconSuite(PyObject
*_self
, PyObject
*_args
)
360 PyObject
*_res
= NULL
;
364 IconAlignmentType align
;
365 IconSuiteRef theIconSuite
;
366 #ifndef PtInIconSuite
367 PyMac_PRECHECK(PtInIconSuite
);
369 if (!PyArg_ParseTuple(_args
, "O&O&hO&",
370 PyMac_GetPoint
, &testPt
,
371 PyMac_GetRect
, &iconRect
,
373 ResObj_Convert
, &theIconSuite
))
375 _rv
= PtInIconSuite(testPt
,
379 _res
= Py_BuildValue("b",
384 static PyObject
*Icn_RectInIconID(PyObject
*_self
, PyObject
*_args
)
386 PyObject
*_res
= NULL
;
390 IconAlignmentType align
;
393 PyMac_PRECHECK(RectInIconID
);
395 if (!PyArg_ParseTuple(_args
, "O&O&hh",
396 PyMac_GetRect
, &testRect
,
397 PyMac_GetRect
, &iconRect
,
401 _rv
= RectInIconID(&testRect
,
405 _res
= Py_BuildValue("b",
410 static PyObject
*Icn_RectInIconSuite(PyObject
*_self
, PyObject
*_args
)
412 PyObject
*_res
= NULL
;
416 IconAlignmentType align
;
417 IconSuiteRef theIconSuite
;
418 #ifndef RectInIconSuite
419 PyMac_PRECHECK(RectInIconSuite
);
421 if (!PyArg_ParseTuple(_args
, "O&O&hO&",
422 PyMac_GetRect
, &testRect
,
423 PyMac_GetRect
, &iconRect
,
425 ResObj_Convert
, &theIconSuite
))
427 _rv
= RectInIconSuite(&testRect
,
431 _res
= Py_BuildValue("b",
436 static PyObject
*Icn_IconIDToRgn(PyObject
*_self
, PyObject
*_args
)
438 PyObject
*_res
= NULL
;
442 IconAlignmentType align
;
445 PyMac_PRECHECK(IconIDToRgn
);
447 if (!PyArg_ParseTuple(_args
, "O&O&hh",
448 ResObj_Convert
, &theRgn
,
449 PyMac_GetRect
, &iconRect
,
453 _err
= IconIDToRgn(theRgn
,
457 if (_err
!= noErr
) return PyMac_Error(_err
);
463 static PyObject
*Icn_IconSuiteToRgn(PyObject
*_self
, PyObject
*_args
)
465 PyObject
*_res
= NULL
;
469 IconAlignmentType align
;
470 IconSuiteRef theIconSuite
;
471 #ifndef IconSuiteToRgn
472 PyMac_PRECHECK(IconSuiteToRgn
);
474 if (!PyArg_ParseTuple(_args
, "O&O&hO&",
475 ResObj_Convert
, &theRgn
,
476 PyMac_GetRect
, &iconRect
,
478 ResObj_Convert
, &theIconSuite
))
480 _err
= IconSuiteToRgn(theRgn
,
484 if (_err
!= noErr
) return PyMac_Error(_err
);
490 static PyObject
*Icn_SetSuiteLabel(PyObject
*_self
, PyObject
*_args
)
492 PyObject
*_res
= NULL
;
494 IconSuiteRef theSuite
;
496 #ifndef SetSuiteLabel
497 PyMac_PRECHECK(SetSuiteLabel
);
499 if (!PyArg_ParseTuple(_args
, "O&h",
500 ResObj_Convert
, &theSuite
,
503 _err
= SetSuiteLabel(theSuite
,
505 if (_err
!= noErr
) return PyMac_Error(_err
);
511 static PyObject
*Icn_GetSuiteLabel(PyObject
*_self
, PyObject
*_args
)
513 PyObject
*_res
= NULL
;
515 IconSuiteRef theSuite
;
516 #ifndef GetSuiteLabel
517 PyMac_PRECHECK(GetSuiteLabel
);
519 if (!PyArg_ParseTuple(_args
, "O&",
520 ResObj_Convert
, &theSuite
))
522 _rv
= GetSuiteLabel(theSuite
);
523 _res
= Py_BuildValue("h",
528 static PyObject
*Icn_PlotIconHandle(PyObject
*_self
, PyObject
*_args
)
530 PyObject
*_res
= NULL
;
533 IconAlignmentType align
;
534 IconTransformType transform
;
536 #ifndef PlotIconHandle
537 PyMac_PRECHECK(PlotIconHandle
);
539 if (!PyArg_ParseTuple(_args
, "O&hhO&",
540 PyMac_GetRect
, &theRect
,
543 ResObj_Convert
, &theIcon
))
545 _err
= PlotIconHandle(&theRect
,
549 if (_err
!= noErr
) return PyMac_Error(_err
);
555 static PyObject
*Icn_PlotSICNHandle(PyObject
*_self
, PyObject
*_args
)
557 PyObject
*_res
= NULL
;
560 IconAlignmentType align
;
561 IconTransformType transform
;
563 #ifndef PlotSICNHandle
564 PyMac_PRECHECK(PlotSICNHandle
);
566 if (!PyArg_ParseTuple(_args
, "O&hhO&",
567 PyMac_GetRect
, &theRect
,
570 ResObj_Convert
, &theSICN
))
572 _err
= PlotSICNHandle(&theRect
,
576 if (_err
!= noErr
) return PyMac_Error(_err
);
582 static PyObject
*Icn_PlotCIconHandle(PyObject
*_self
, PyObject
*_args
)
584 PyObject
*_res
= NULL
;
587 IconAlignmentType align
;
588 IconTransformType transform
;
589 CIconHandle theCIcon
;
590 #ifndef PlotCIconHandle
591 PyMac_PRECHECK(PlotCIconHandle
);
593 if (!PyArg_ParseTuple(_args
, "O&hhO&",
594 PyMac_GetRect
, &theRect
,
597 ResObj_Convert
, &theCIcon
))
599 _err
= PlotCIconHandle(&theRect
,
603 if (_err
!= noErr
) return PyMac_Error(_err
);
609 #if !TARGET_API_MAC_CARBON
611 static PyObject
*Icn_IconServicesTerminate(PyObject
*_self
, PyObject
*_args
)
613 PyObject
*_res
= NULL
;
614 #ifndef IconServicesTerminate
615 PyMac_PRECHECK(IconServicesTerminate
);
617 if (!PyArg_ParseTuple(_args
, ""))
619 IconServicesTerminate();
626 static PyObject
*Icn_IconRefToIconFamily(PyObject
*_self
, PyObject
*_args
)
628 PyObject
*_res
= NULL
;
631 IconSelectorValue whichIcons
;
632 IconFamilyHandle iconFamily
;
633 #ifndef IconRefToIconFamily
634 PyMac_PRECHECK(IconRefToIconFamily
);
636 if (!PyArg_ParseTuple(_args
, "O&l",
637 ResObj_Convert
, &theIconRef
,
640 _err
= IconRefToIconFamily(theIconRef
,
643 if (_err
!= noErr
) return PyMac_Error(_err
);
644 _res
= Py_BuildValue("O&",
645 ResObj_New
, iconFamily
);
649 static PyObject
*Icn_IconFamilyToIconSuite(PyObject
*_self
, PyObject
*_args
)
651 PyObject
*_res
= NULL
;
653 IconFamilyHandle iconFamily
;
654 IconSelectorValue whichIcons
;
655 IconSuiteRef iconSuite
;
656 #ifndef IconFamilyToIconSuite
657 PyMac_PRECHECK(IconFamilyToIconSuite
);
659 if (!PyArg_ParseTuple(_args
, "O&l",
660 ResObj_Convert
, &iconFamily
,
663 _err
= IconFamilyToIconSuite(iconFamily
,
666 if (_err
!= noErr
) return PyMac_Error(_err
);
667 _res
= Py_BuildValue("O&",
668 ResObj_New
, iconSuite
);
672 static PyObject
*Icn_IconSuiteToIconFamily(PyObject
*_self
, PyObject
*_args
)
674 PyObject
*_res
= NULL
;
676 IconSuiteRef iconSuite
;
677 IconSelectorValue whichIcons
;
678 IconFamilyHandle iconFamily
;
679 #ifndef IconSuiteToIconFamily
680 PyMac_PRECHECK(IconSuiteToIconFamily
);
682 if (!PyArg_ParseTuple(_args
, "O&l",
683 ResObj_Convert
, &iconSuite
,
686 _err
= IconSuiteToIconFamily(iconSuite
,
689 if (_err
!= noErr
) return PyMac_Error(_err
);
690 _res
= Py_BuildValue("O&",
691 ResObj_New
, iconFamily
);
695 static PyObject
*Icn_SetIconFamilyData(PyObject
*_self
, PyObject
*_args
)
697 PyObject
*_res
= NULL
;
699 IconFamilyHandle iconFamily
;
702 #ifndef SetIconFamilyData
703 PyMac_PRECHECK(SetIconFamilyData
);
705 if (!PyArg_ParseTuple(_args
, "O&O&O&",
706 ResObj_Convert
, &iconFamily
,
707 PyMac_GetOSType
, &iconType
,
710 _err
= SetIconFamilyData(iconFamily
,
713 if (_err
!= noErr
) return PyMac_Error(_err
);
719 static PyObject
*Icn_GetIconFamilyData(PyObject
*_self
, PyObject
*_args
)
721 PyObject
*_res
= NULL
;
723 IconFamilyHandle iconFamily
;
726 #ifndef GetIconFamilyData
727 PyMac_PRECHECK(GetIconFamilyData
);
729 if (!PyArg_ParseTuple(_args
, "O&O&O&",
730 ResObj_Convert
, &iconFamily
,
731 PyMac_GetOSType
, &iconType
,
734 _err
= GetIconFamilyData(iconFamily
,
737 if (_err
!= noErr
) return PyMac_Error(_err
);
743 static PyObject
*Icn_GetIconRefOwners(PyObject
*_self
, PyObject
*_args
)
745 PyObject
*_res
= NULL
;
749 #ifndef GetIconRefOwners
750 PyMac_PRECHECK(GetIconRefOwners
);
752 if (!PyArg_ParseTuple(_args
, "O&",
753 ResObj_Convert
, &theIconRef
))
755 _err
= GetIconRefOwners(theIconRef
,
757 if (_err
!= noErr
) return PyMac_Error(_err
);
758 _res
= Py_BuildValue("H",
763 static PyObject
*Icn_AcquireIconRef(PyObject
*_self
, PyObject
*_args
)
765 PyObject
*_res
= NULL
;
768 #ifndef AcquireIconRef
769 PyMac_PRECHECK(AcquireIconRef
);
771 if (!PyArg_ParseTuple(_args
, "O&",
772 ResObj_Convert
, &theIconRef
))
774 _err
= AcquireIconRef(theIconRef
);
775 if (_err
!= noErr
) return PyMac_Error(_err
);
781 static PyObject
*Icn_ReleaseIconRef(PyObject
*_self
, PyObject
*_args
)
783 PyObject
*_res
= NULL
;
786 #ifndef ReleaseIconRef
787 PyMac_PRECHECK(ReleaseIconRef
);
789 if (!PyArg_ParseTuple(_args
, "O&",
790 ResObj_Convert
, &theIconRef
))
792 _err
= ReleaseIconRef(theIconRef
);
793 if (_err
!= noErr
) return PyMac_Error(_err
);
799 static PyObject
*Icn_GetIconRefFromFile(PyObject
*_self
, PyObject
*_args
)
801 PyObject
*_res
= NULL
;
806 #ifndef GetIconRefFromFile
807 PyMac_PRECHECK(GetIconRefFromFile
);
809 if (!PyArg_ParseTuple(_args
, "O&",
810 PyMac_GetFSSpec
, &theFile
))
812 _err
= GetIconRefFromFile(&theFile
,
815 if (_err
!= noErr
) return PyMac_Error(_err
);
816 _res
= Py_BuildValue("O&h",
817 ResObj_New
, theIconRef
,
822 static PyObject
*Icn_GetIconRef(PyObject
*_self
, PyObject
*_args
)
824 PyObject
*_res
= NULL
;
831 PyMac_PRECHECK(GetIconRef
);
833 if (!PyArg_ParseTuple(_args
, "hO&O&",
835 PyMac_GetOSType
, &creator
,
836 PyMac_GetOSType
, &iconType
))
838 _err
= GetIconRef(vRefNum
,
842 if (_err
!= noErr
) return PyMac_Error(_err
);
843 _res
= Py_BuildValue("O&",
844 ResObj_New
, theIconRef
);
848 static PyObject
*Icn_GetIconRefFromFolder(PyObject
*_self
, PyObject
*_args
)
850 PyObject
*_res
= NULL
;
853 SInt32 parentFolderID
;
856 SInt8 accessPrivileges
;
858 #ifndef GetIconRefFromFolder
859 PyMac_PRECHECK(GetIconRefFromFolder
);
861 if (!PyArg_ParseTuple(_args
, "hllbb",
868 _err
= GetIconRefFromFolder(vRefNum
,
874 if (_err
!= noErr
) return PyMac_Error(_err
);
875 _res
= Py_BuildValue("O&",
876 ResObj_New
, theIconRef
);
880 static PyObject
*Icn_RegisterIconRefFromIconFamily(PyObject
*_self
, PyObject
*_args
)
882 PyObject
*_res
= NULL
;
886 IconFamilyHandle iconFamily
;
888 #ifndef RegisterIconRefFromIconFamily
889 PyMac_PRECHECK(RegisterIconRefFromIconFamily
);
891 if (!PyArg_ParseTuple(_args
, "O&O&O&",
892 PyMac_GetOSType
, &creator
,
893 PyMac_GetOSType
, &iconType
,
894 ResObj_Convert
, &iconFamily
))
896 _err
= RegisterIconRefFromIconFamily(creator
,
900 if (_err
!= noErr
) return PyMac_Error(_err
);
901 _res
= Py_BuildValue("O&",
902 ResObj_New
, theIconRef
);
906 static PyObject
*Icn_RegisterIconRefFromResource(PyObject
*_self
, PyObject
*_args
)
908 PyObject
*_res
= NULL
;
915 #ifndef RegisterIconRefFromResource
916 PyMac_PRECHECK(RegisterIconRefFromResource
);
918 if (!PyArg_ParseTuple(_args
, "O&O&O&h",
919 PyMac_GetOSType
, &creator
,
920 PyMac_GetOSType
, &iconType
,
921 PyMac_GetFSSpec
, &resourceFile
,
924 _err
= RegisterIconRefFromResource(creator
,
929 if (_err
!= noErr
) return PyMac_Error(_err
);
930 _res
= Py_BuildValue("O&",
931 ResObj_New
, theIconRef
);
935 static PyObject
*Icn_UnregisterIconRef(PyObject
*_self
, PyObject
*_args
)
937 PyObject
*_res
= NULL
;
941 #ifndef UnregisterIconRef
942 PyMac_PRECHECK(UnregisterIconRef
);
944 if (!PyArg_ParseTuple(_args
, "O&O&",
945 PyMac_GetOSType
, &creator
,
946 PyMac_GetOSType
, &iconType
))
948 _err
= UnregisterIconRef(creator
,
950 if (_err
!= noErr
) return PyMac_Error(_err
);
956 static PyObject
*Icn_UpdateIconRef(PyObject
*_self
, PyObject
*_args
)
958 PyObject
*_res
= NULL
;
961 #ifndef UpdateIconRef
962 PyMac_PRECHECK(UpdateIconRef
);
964 if (!PyArg_ParseTuple(_args
, "O&",
965 ResObj_Convert
, &theIconRef
))
967 _err
= UpdateIconRef(theIconRef
);
968 if (_err
!= noErr
) return PyMac_Error(_err
);
974 static PyObject
*Icn_OverrideIconRefFromResource(PyObject
*_self
, PyObject
*_args
)
976 PyObject
*_res
= NULL
;
981 #ifndef OverrideIconRefFromResource
982 PyMac_PRECHECK(OverrideIconRefFromResource
);
984 if (!PyArg_ParseTuple(_args
, "O&O&h",
985 ResObj_Convert
, &theIconRef
,
986 PyMac_GetFSSpec
, &resourceFile
,
989 _err
= OverrideIconRefFromResource(theIconRef
,
992 if (_err
!= noErr
) return PyMac_Error(_err
);
998 static PyObject
*Icn_OverrideIconRef(PyObject
*_self
, PyObject
*_args
)
1000 PyObject
*_res
= NULL
;
1004 #ifndef OverrideIconRef
1005 PyMac_PRECHECK(OverrideIconRef
);
1007 if (!PyArg_ParseTuple(_args
, "O&O&",
1008 ResObj_Convert
, &oldIconRef
,
1009 ResObj_Convert
, &newIconRef
))
1011 _err
= OverrideIconRef(oldIconRef
,
1013 if (_err
!= noErr
) return PyMac_Error(_err
);
1019 static PyObject
*Icn_RemoveIconRefOverride(PyObject
*_self
, PyObject
*_args
)
1021 PyObject
*_res
= NULL
;
1024 #ifndef RemoveIconRefOverride
1025 PyMac_PRECHECK(RemoveIconRefOverride
);
1027 if (!PyArg_ParseTuple(_args
, "O&",
1028 ResObj_Convert
, &theIconRef
))
1030 _err
= RemoveIconRefOverride(theIconRef
);
1031 if (_err
!= noErr
) return PyMac_Error(_err
);
1037 static PyObject
*Icn_CompositeIconRef(PyObject
*_self
, PyObject
*_args
)
1039 PyObject
*_res
= NULL
;
1041 IconRef backgroundIconRef
;
1042 IconRef foregroundIconRef
;
1043 IconRef compositeIconRef
;
1044 #ifndef CompositeIconRef
1045 PyMac_PRECHECK(CompositeIconRef
);
1047 if (!PyArg_ParseTuple(_args
, "O&O&",
1048 ResObj_Convert
, &backgroundIconRef
,
1049 ResObj_Convert
, &foregroundIconRef
))
1051 _err
= CompositeIconRef(backgroundIconRef
,
1054 if (_err
!= noErr
) return PyMac_Error(_err
);
1055 _res
= Py_BuildValue("O&",
1056 ResObj_New
, compositeIconRef
);
1060 static PyObject
*Icn_IsIconRefComposite(PyObject
*_self
, PyObject
*_args
)
1062 PyObject
*_res
= NULL
;
1064 IconRef compositeIconRef
;
1065 IconRef backgroundIconRef
;
1066 IconRef foregroundIconRef
;
1067 #ifndef IsIconRefComposite
1068 PyMac_PRECHECK(IsIconRefComposite
);
1070 if (!PyArg_ParseTuple(_args
, "O&",
1071 ResObj_Convert
, &compositeIconRef
))
1073 _err
= IsIconRefComposite(compositeIconRef
,
1075 &foregroundIconRef
);
1076 if (_err
!= noErr
) return PyMac_Error(_err
);
1077 _res
= Py_BuildValue("O&O&",
1078 ResObj_New
, backgroundIconRef
,
1079 ResObj_New
, foregroundIconRef
);
1083 static PyObject
*Icn_IsValidIconRef(PyObject
*_self
, PyObject
*_args
)
1085 PyObject
*_res
= NULL
;
1088 #ifndef IsValidIconRef
1089 PyMac_PRECHECK(IsValidIconRef
);
1091 if (!PyArg_ParseTuple(_args
, "O&",
1092 ResObj_Convert
, &theIconRef
))
1094 _rv
= IsValidIconRef(theIconRef
);
1095 _res
= Py_BuildValue("b",
1100 static PyObject
*Icn_PlotIconRef(PyObject
*_self
, PyObject
*_args
)
1102 PyObject
*_res
= NULL
;
1105 IconAlignmentType align
;
1106 IconTransformType transform
;
1107 IconServicesUsageFlags theIconServicesUsageFlags
;
1110 PyMac_PRECHECK(PlotIconRef
);
1112 if (!PyArg_ParseTuple(_args
, "O&hhlO&",
1113 PyMac_GetRect
, &theRect
,
1116 &theIconServicesUsageFlags
,
1117 ResObj_Convert
, &theIconRef
))
1119 _err
= PlotIconRef(&theRect
,
1122 theIconServicesUsageFlags
,
1124 if (_err
!= noErr
) return PyMac_Error(_err
);
1130 static PyObject
*Icn_PtInIconRef(PyObject
*_self
, PyObject
*_args
)
1132 PyObject
*_res
= NULL
;
1136 IconAlignmentType align
;
1137 IconServicesUsageFlags theIconServicesUsageFlags
;
1140 PyMac_PRECHECK(PtInIconRef
);
1142 if (!PyArg_ParseTuple(_args
, "O&O&hlO&",
1143 PyMac_GetPoint
, &testPt
,
1144 PyMac_GetRect
, &iconRect
,
1146 &theIconServicesUsageFlags
,
1147 ResObj_Convert
, &theIconRef
))
1149 _rv
= PtInIconRef(&testPt
,
1152 theIconServicesUsageFlags
,
1154 _res
= Py_BuildValue("b",
1159 static PyObject
*Icn_RectInIconRef(PyObject
*_self
, PyObject
*_args
)
1161 PyObject
*_res
= NULL
;
1165 IconAlignmentType align
;
1166 IconServicesUsageFlags iconServicesUsageFlags
;
1168 #ifndef RectInIconRef
1169 PyMac_PRECHECK(RectInIconRef
);
1171 if (!PyArg_ParseTuple(_args
, "O&O&hlO&",
1172 PyMac_GetRect
, &testRect
,
1173 PyMac_GetRect
, &iconRect
,
1175 &iconServicesUsageFlags
,
1176 ResObj_Convert
, &theIconRef
))
1178 _rv
= RectInIconRef(&testRect
,
1181 iconServicesUsageFlags
,
1183 _res
= Py_BuildValue("b",
1188 static PyObject
*Icn_IconRefToRgn(PyObject
*_self
, PyObject
*_args
)
1190 PyObject
*_res
= NULL
;
1194 IconAlignmentType align
;
1195 IconServicesUsageFlags iconServicesUsageFlags
;
1197 #ifndef IconRefToRgn
1198 PyMac_PRECHECK(IconRefToRgn
);
1200 if (!PyArg_ParseTuple(_args
, "O&O&hlO&",
1201 ResObj_Convert
, &theRgn
,
1202 PyMac_GetRect
, &iconRect
,
1204 &iconServicesUsageFlags
,
1205 ResObj_Convert
, &theIconRef
))
1207 _err
= IconRefToRgn(theRgn
,
1210 iconServicesUsageFlags
,
1212 if (_err
!= noErr
) return PyMac_Error(_err
);
1218 static PyObject
*Icn_GetIconSizesFromIconRef(PyObject
*_self
, PyObject
*_args
)
1220 PyObject
*_res
= NULL
;
1222 IconSelectorValue iconSelectorInput
;
1223 IconSelectorValue iconSelectorOutputPtr
;
1224 IconServicesUsageFlags iconServicesUsageFlags
;
1226 #ifndef GetIconSizesFromIconRef
1227 PyMac_PRECHECK(GetIconSizesFromIconRef
);
1229 if (!PyArg_ParseTuple(_args
, "llO&",
1231 &iconServicesUsageFlags
,
1232 ResObj_Convert
, &theIconRef
))
1234 _err
= GetIconSizesFromIconRef(iconSelectorInput
,
1235 &iconSelectorOutputPtr
,
1236 iconServicesUsageFlags
,
1238 if (_err
!= noErr
) return PyMac_Error(_err
);
1239 _res
= Py_BuildValue("l",
1240 iconSelectorOutputPtr
);
1244 static PyObject
*Icn_FlushIconRefs(PyObject
*_self
, PyObject
*_args
)
1246 PyObject
*_res
= NULL
;
1250 #ifndef FlushIconRefs
1251 PyMac_PRECHECK(FlushIconRefs
);
1253 if (!PyArg_ParseTuple(_args
, "O&O&",
1254 PyMac_GetOSType
, &creator
,
1255 PyMac_GetOSType
, &iconType
))
1257 _err
= FlushIconRefs(creator
,
1259 if (_err
!= noErr
) return PyMac_Error(_err
);
1265 static PyObject
*Icn_FlushIconRefsByVolume(PyObject
*_self
, PyObject
*_args
)
1267 PyObject
*_res
= NULL
;
1270 #ifndef FlushIconRefsByVolume
1271 PyMac_PRECHECK(FlushIconRefsByVolume
);
1273 if (!PyArg_ParseTuple(_args
, "h",
1276 _err
= FlushIconRefsByVolume(vRefNum
);
1277 if (_err
!= noErr
) return PyMac_Error(_err
);
1283 static PyObject
*Icn_SetCustomIconsEnabled(PyObject
*_self
, PyObject
*_args
)
1285 PyObject
*_res
= NULL
;
1288 Boolean enableCustomIcons
;
1289 #ifndef SetCustomIconsEnabled
1290 PyMac_PRECHECK(SetCustomIconsEnabled
);
1292 if (!PyArg_ParseTuple(_args
, "hb",
1294 &enableCustomIcons
))
1296 _err
= SetCustomIconsEnabled(vRefNum
,
1298 if (_err
!= noErr
) return PyMac_Error(_err
);
1304 static PyObject
*Icn_GetCustomIconsEnabled(PyObject
*_self
, PyObject
*_args
)
1306 PyObject
*_res
= NULL
;
1309 Boolean customIconsEnabled
;
1310 #ifndef GetCustomIconsEnabled
1311 PyMac_PRECHECK(GetCustomIconsEnabled
);
1313 if (!PyArg_ParseTuple(_args
, "h",
1316 _err
= GetCustomIconsEnabled(vRefNum
,
1317 &customIconsEnabled
);
1318 if (_err
!= noErr
) return PyMac_Error(_err
);
1319 _res
= Py_BuildValue("b",
1320 customIconsEnabled
);
1324 static PyObject
*Icn_IsIconRefMaskEmpty(PyObject
*_self
, PyObject
*_args
)
1326 PyObject
*_res
= NULL
;
1329 #ifndef IsIconRefMaskEmpty
1330 PyMac_PRECHECK(IsIconRefMaskEmpty
);
1332 if (!PyArg_ParseTuple(_args
, "O&",
1333 ResObj_Convert
, &iconRef
))
1335 _rv
= IsIconRefMaskEmpty(iconRef
);
1336 _res
= Py_BuildValue("b",
1341 #if TARGET_API_MAC_CARBON
1343 static PyObject
*Icn_GetIconRefVariant(PyObject
*_self
, PyObject
*_args
)
1345 PyObject
*_res
= NULL
;
1349 IconTransformType outTransform
;
1350 #ifndef GetIconRefVariant
1351 PyMac_PRECHECK(GetIconRefVariant
);
1353 if (!PyArg_ParseTuple(_args
, "O&O&",
1354 ResObj_Convert
, &inIconRef
,
1355 PyMac_GetOSType
, &inVariant
))
1357 _rv
= GetIconRefVariant(inIconRef
,
1360 _res
= Py_BuildValue("O&h",
1367 #if TARGET_API_MAC_CARBON
1369 static PyObject
*Icn_RegisterIconRefFromIconFile(PyObject
*_self
, PyObject
*_args
)
1371 PyObject
*_res
= NULL
;
1377 #ifndef RegisterIconRefFromIconFile
1378 PyMac_PRECHECK(RegisterIconRefFromIconFile
);
1380 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1381 PyMac_GetOSType
, &creator
,
1382 PyMac_GetOSType
, &iconType
,
1383 PyMac_GetFSSpec
, &iconFile
))
1385 _err
= RegisterIconRefFromIconFile(creator
,
1389 if (_err
!= noErr
) return PyMac_Error(_err
);
1390 _res
= Py_BuildValue("O&",
1391 ResObj_New
, theIconRef
);
1396 #if TARGET_API_MAC_CARBON
1398 static PyObject
*Icn_ReadIconFile(PyObject
*_self
, PyObject
*_args
)
1400 PyObject
*_res
= NULL
;
1403 IconFamilyHandle iconFamily
;
1404 #ifndef ReadIconFile
1405 PyMac_PRECHECK(ReadIconFile
);
1407 if (!PyArg_ParseTuple(_args
, "O&",
1408 PyMac_GetFSSpec
, &iconFile
))
1410 _err
= ReadIconFile(&iconFile
,
1412 if (_err
!= noErr
) return PyMac_Error(_err
);
1413 _res
= Py_BuildValue("O&",
1414 ResObj_New
, iconFamily
);
1419 #if TARGET_API_MAC_CARBON
1421 static PyObject
*Icn_WriteIconFile(PyObject
*_self
, PyObject
*_args
)
1423 PyObject
*_res
= NULL
;
1425 IconFamilyHandle iconFamily
;
1427 #ifndef WriteIconFile
1428 PyMac_PRECHECK(WriteIconFile
);
1430 if (!PyArg_ParseTuple(_args
, "O&O&",
1431 ResObj_Convert
, &iconFamily
,
1432 PyMac_GetFSSpec
, &iconFile
))
1434 _err
= WriteIconFile(iconFamily
,
1436 if (_err
!= noErr
) return PyMac_Error(_err
);
1443 static PyMethodDef Icn_methods
[] = {
1444 {"GetCIcon", (PyCFunction
)Icn_GetCIcon
, 1,
1445 "(SInt16 iconID) -> (CIconHandle _rv)"},
1446 {"PlotCIcon", (PyCFunction
)Icn_PlotCIcon
, 1,
1447 "(Rect theRect, CIconHandle theIcon) -> None"},
1448 {"DisposeCIcon", (PyCFunction
)Icn_DisposeCIcon
, 1,
1449 "(CIconHandle theIcon) -> None"},
1450 {"GetIcon", (PyCFunction
)Icn_GetIcon
, 1,
1451 "(SInt16 iconID) -> (Handle _rv)"},
1452 {"PlotIcon", (PyCFunction
)Icn_PlotIcon
, 1,
1453 "(Rect theRect, Handle theIcon) -> None"},
1454 {"PlotIconID", (PyCFunction
)Icn_PlotIconID
, 1,
1455 "(Rect theRect, IconAlignmentType align, IconTransformType transform, SInt16 theResID) -> None"},
1456 {"NewIconSuite", (PyCFunction
)Icn_NewIconSuite
, 1,
1457 "() -> (IconSuiteRef theIconSuite)"},
1458 {"AddIconToSuite", (PyCFunction
)Icn_AddIconToSuite
, 1,
1459 "(Handle theIconData, IconSuiteRef theSuite, ResType theType) -> None"},
1460 {"GetIconFromSuite", (PyCFunction
)Icn_GetIconFromSuite
, 1,
1461 "(IconSuiteRef theSuite, ResType theType) -> (Handle theIconData)"},
1462 {"GetIconSuite", (PyCFunction
)Icn_GetIconSuite
, 1,
1463 "(SInt16 theResID, IconSelectorValue selector) -> (IconSuiteRef theIconSuite)"},
1464 {"DisposeIconSuite", (PyCFunction
)Icn_DisposeIconSuite
, 1,
1465 "(IconSuiteRef theIconSuite, Boolean disposeData) -> None"},
1466 {"PlotIconSuite", (PyCFunction
)Icn_PlotIconSuite
, 1,
1467 "(Rect theRect, IconAlignmentType align, IconTransformType transform, IconSuiteRef theIconSuite) -> None"},
1468 {"LoadIconCache", (PyCFunction
)Icn_LoadIconCache
, 1,
1469 "(Rect theRect, IconAlignmentType align, IconTransformType transform, IconCacheRef theIconCache) -> None"},
1470 {"GetLabel", (PyCFunction
)Icn_GetLabel
, 1,
1471 "(SInt16 labelNumber, Str255 labelString) -> (RGBColor labelColor)"},
1472 {"PtInIconID", (PyCFunction
)Icn_PtInIconID
, 1,
1473 "(Point testPt, Rect iconRect, IconAlignmentType align, SInt16 iconID) -> (Boolean _rv)"},
1474 {"PtInIconSuite", (PyCFunction
)Icn_PtInIconSuite
, 1,
1475 "(Point testPt, Rect iconRect, IconAlignmentType align, IconSuiteRef theIconSuite) -> (Boolean _rv)"},
1476 {"RectInIconID", (PyCFunction
)Icn_RectInIconID
, 1,
1477 "(Rect testRect, Rect iconRect, IconAlignmentType align, SInt16 iconID) -> (Boolean _rv)"},
1478 {"RectInIconSuite", (PyCFunction
)Icn_RectInIconSuite
, 1,
1479 "(Rect testRect, Rect iconRect, IconAlignmentType align, IconSuiteRef theIconSuite) -> (Boolean _rv)"},
1480 {"IconIDToRgn", (PyCFunction
)Icn_IconIDToRgn
, 1,
1481 "(RgnHandle theRgn, Rect iconRect, IconAlignmentType align, SInt16 iconID) -> None"},
1482 {"IconSuiteToRgn", (PyCFunction
)Icn_IconSuiteToRgn
, 1,
1483 "(RgnHandle theRgn, Rect iconRect, IconAlignmentType align, IconSuiteRef theIconSuite) -> None"},
1484 {"SetSuiteLabel", (PyCFunction
)Icn_SetSuiteLabel
, 1,
1485 "(IconSuiteRef theSuite, SInt16 theLabel) -> None"},
1486 {"GetSuiteLabel", (PyCFunction
)Icn_GetSuiteLabel
, 1,
1487 "(IconSuiteRef theSuite) -> (SInt16 _rv)"},
1488 {"PlotIconHandle", (PyCFunction
)Icn_PlotIconHandle
, 1,
1489 "(Rect theRect, IconAlignmentType align, IconTransformType transform, Handle theIcon) -> None"},
1490 {"PlotSICNHandle", (PyCFunction
)Icn_PlotSICNHandle
, 1,
1491 "(Rect theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN) -> None"},
1492 {"PlotCIconHandle", (PyCFunction
)Icn_PlotCIconHandle
, 1,
1493 "(Rect theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon) -> None"},
1495 #if !TARGET_API_MAC_CARBON
1496 {"IconServicesTerminate", (PyCFunction
)Icn_IconServicesTerminate
, 1,
1499 {"IconRefToIconFamily", (PyCFunction
)Icn_IconRefToIconFamily
, 1,
1500 "(IconRef theIconRef, IconSelectorValue whichIcons) -> (IconFamilyHandle iconFamily)"},
1501 {"IconFamilyToIconSuite", (PyCFunction
)Icn_IconFamilyToIconSuite
, 1,
1502 "(IconFamilyHandle iconFamily, IconSelectorValue whichIcons) -> (IconSuiteRef iconSuite)"},
1503 {"IconSuiteToIconFamily", (PyCFunction
)Icn_IconSuiteToIconFamily
, 1,
1504 "(IconSuiteRef iconSuite, IconSelectorValue whichIcons) -> (IconFamilyHandle iconFamily)"},
1505 {"SetIconFamilyData", (PyCFunction
)Icn_SetIconFamilyData
, 1,
1506 "(IconFamilyHandle iconFamily, OSType iconType, Handle h) -> None"},
1507 {"GetIconFamilyData", (PyCFunction
)Icn_GetIconFamilyData
, 1,
1508 "(IconFamilyHandle iconFamily, OSType iconType, Handle h) -> None"},
1509 {"GetIconRefOwners", (PyCFunction
)Icn_GetIconRefOwners
, 1,
1510 "(IconRef theIconRef) -> (UInt16 owners)"},
1511 {"AcquireIconRef", (PyCFunction
)Icn_AcquireIconRef
, 1,
1512 "(IconRef theIconRef) -> None"},
1513 {"ReleaseIconRef", (PyCFunction
)Icn_ReleaseIconRef
, 1,
1514 "(IconRef theIconRef) -> None"},
1515 {"GetIconRefFromFile", (PyCFunction
)Icn_GetIconRefFromFile
, 1,
1516 "(FSSpec theFile) -> (IconRef theIconRef, SInt16 theLabel)"},
1517 {"GetIconRef", (PyCFunction
)Icn_GetIconRef
, 1,
1518 "(SInt16 vRefNum, OSType creator, OSType iconType) -> (IconRef theIconRef)"},
1519 {"GetIconRefFromFolder", (PyCFunction
)Icn_GetIconRefFromFolder
, 1,
1520 "(SInt16 vRefNum, SInt32 parentFolderID, SInt32 folderID, SInt8 attributes, SInt8 accessPrivileges) -> (IconRef theIconRef)"},
1521 {"RegisterIconRefFromIconFamily", (PyCFunction
)Icn_RegisterIconRefFromIconFamily
, 1,
1522 "(OSType creator, OSType iconType, IconFamilyHandle iconFamily) -> (IconRef theIconRef)"},
1523 {"RegisterIconRefFromResource", (PyCFunction
)Icn_RegisterIconRefFromResource
, 1,
1524 "(OSType creator, OSType iconType, FSSpec resourceFile, SInt16 resourceID) -> (IconRef theIconRef)"},
1525 {"UnregisterIconRef", (PyCFunction
)Icn_UnregisterIconRef
, 1,
1526 "(OSType creator, OSType iconType) -> None"},
1527 {"UpdateIconRef", (PyCFunction
)Icn_UpdateIconRef
, 1,
1528 "(IconRef theIconRef) -> None"},
1529 {"OverrideIconRefFromResource", (PyCFunction
)Icn_OverrideIconRefFromResource
, 1,
1530 "(IconRef theIconRef, FSSpec resourceFile, SInt16 resourceID) -> None"},
1531 {"OverrideIconRef", (PyCFunction
)Icn_OverrideIconRef
, 1,
1532 "(IconRef oldIconRef, IconRef newIconRef) -> None"},
1533 {"RemoveIconRefOverride", (PyCFunction
)Icn_RemoveIconRefOverride
, 1,
1534 "(IconRef theIconRef) -> None"},
1535 {"CompositeIconRef", (PyCFunction
)Icn_CompositeIconRef
, 1,
1536 "(IconRef backgroundIconRef, IconRef foregroundIconRef) -> (IconRef compositeIconRef)"},
1537 {"IsIconRefComposite", (PyCFunction
)Icn_IsIconRefComposite
, 1,
1538 "(IconRef compositeIconRef) -> (IconRef backgroundIconRef, IconRef foregroundIconRef)"},
1539 {"IsValidIconRef", (PyCFunction
)Icn_IsValidIconRef
, 1,
1540 "(IconRef theIconRef) -> (Boolean _rv)"},
1541 {"PlotIconRef", (PyCFunction
)Icn_PlotIconRef
, 1,
1542 "(Rect theRect, IconAlignmentType align, IconTransformType transform, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef) -> None"},
1543 {"PtInIconRef", (PyCFunction
)Icn_PtInIconRef
, 1,
1544 "(Point testPt, Rect iconRect, IconAlignmentType align, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef) -> (Boolean _rv)"},
1545 {"RectInIconRef", (PyCFunction
)Icn_RectInIconRef
, 1,
1546 "(Rect testRect, Rect iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef) -> (Boolean _rv)"},
1547 {"IconRefToRgn", (PyCFunction
)Icn_IconRefToRgn
, 1,
1548 "(RgnHandle theRgn, Rect iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef) -> None"},
1549 {"GetIconSizesFromIconRef", (PyCFunction
)Icn_GetIconSizesFromIconRef
, 1,
1550 "(IconSelectorValue iconSelectorInput, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef) -> (IconSelectorValue iconSelectorOutputPtr)"},
1551 {"FlushIconRefs", (PyCFunction
)Icn_FlushIconRefs
, 1,
1552 "(OSType creator, OSType iconType) -> None"},
1553 {"FlushIconRefsByVolume", (PyCFunction
)Icn_FlushIconRefsByVolume
, 1,
1554 "(SInt16 vRefNum) -> None"},
1555 {"SetCustomIconsEnabled", (PyCFunction
)Icn_SetCustomIconsEnabled
, 1,
1556 "(SInt16 vRefNum, Boolean enableCustomIcons) -> None"},
1557 {"GetCustomIconsEnabled", (PyCFunction
)Icn_GetCustomIconsEnabled
, 1,
1558 "(SInt16 vRefNum) -> (Boolean customIconsEnabled)"},
1559 {"IsIconRefMaskEmpty", (PyCFunction
)Icn_IsIconRefMaskEmpty
, 1,
1560 "(IconRef iconRef) -> (Boolean _rv)"},
1562 #if TARGET_API_MAC_CARBON
1563 {"GetIconRefVariant", (PyCFunction
)Icn_GetIconRefVariant
, 1,
1564 "(IconRef inIconRef, OSType inVariant) -> (IconRef _rv, IconTransformType outTransform)"},
1567 #if TARGET_API_MAC_CARBON
1568 {"RegisterIconRefFromIconFile", (PyCFunction
)Icn_RegisterIconRefFromIconFile
, 1,
1569 "(OSType creator, OSType iconType, FSSpec iconFile) -> (IconRef theIconRef)"},
1572 #if TARGET_API_MAC_CARBON
1573 {"ReadIconFile", (PyCFunction
)Icn_ReadIconFile
, 1,
1574 "(FSSpec iconFile) -> (IconFamilyHandle iconFamily)"},
1577 #if TARGET_API_MAC_CARBON
1578 {"WriteIconFile", (PyCFunction
)Icn_WriteIconFile
, 1,
1579 "(IconFamilyHandle iconFamily, FSSpec iconFile) -> None"},
1595 m
= Py_InitModule("_Icn", Icn_methods
);
1596 d
= PyModule_GetDict(m
);
1597 Icn_Error
= PyMac_GetOSErrException();
1598 if (Icn_Error
== NULL
||
1599 PyDict_SetItemString(d
, "Error", Icn_Error
) != 0)
1603 /* ======================== End module _Icn ========================= */