[Python-checkins] python/dist/src/Mac/Modules/icn _Icnmodule.c,1.7,1.7.6.1 icnsupport.py,1.9,1.9.6.1

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Fri, 18 Apr 2003 01:59:17 -0700


Update of /cvsroot/python/python/dist/src/Mac/Modules/icn
In directory sc8-pr-cvs1:/tmp/cvs-serv28363/Mac/Modules/icn

Modified Files:
      Tag: getargs_mask_mods
	_Icnmodule.c icnsupport.py 
Log Message:
Fixes for the new PyArg_ParseTuple k and K format chars, and the
changed semantics of h. Only lightly tested, but the IDE works
again.

These changes may not be needed anymore now that the semantic change
to h has been reverted, so I'm checking it in on a branch.


Index: _Icnmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/icn/_Icnmodule.c,v
retrieving revision 1.7
retrieving revision 1.7.6.1
diff -C2 -d -r1.7 -r1.7.6.1
*** _Icnmodule.c	12 Dec 2002 10:31:51 -0000	1.7
--- _Icnmodule.c	18 Apr 2003 08:58:44 -0000	1.7.6.1
***************
*** 15,21 ****
  /* Macro to test whether a weak-loaded CFM function exists */
  #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
!     	PyErr_SetString(PyExc_NotImplementedError, \
!     	"Not available in this shared library/OS version"); \
!     	return NULL; \
      }} while(0)
  
--- 15,21 ----
  /* Macro to test whether a weak-loaded CFM function exists */
  #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
!         PyErr_SetString(PyExc_NotImplementedError, \
!         "Not available in this shared library/OS version"); \
!         return NULL; \
      }} while(0)
  
***************
*** 38,42 ****
  	PyMac_PRECHECK(GetCIcon);
  #endif
! 	if (!PyArg_ParseTuple(_args, "h",
  	                      &iconID))
  		return NULL;
--- 38,42 ----
  	PyMac_PRECHECK(GetCIcon);
  #endif
! 	if (!PyArg_ParseTuple(_args, "H",
  	                      &iconID))
  		return NULL;
***************
*** 90,94 ****
  	PyMac_PRECHECK(GetIcon);
  #endif
! 	if (!PyArg_ParseTuple(_args, "h",
  	                      &iconID))
  		return NULL;
--- 90,94 ----
  	PyMac_PRECHECK(GetIcon);
  #endif
! 	if (!PyArg_ParseTuple(_args, "H",
  	                      &iconID))
  		return NULL;
***************
*** 129,133 ****
  	PyMac_PRECHECK(PlotIconID);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&hhh",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
--- 129,133 ----
  	PyMac_PRECHECK(PlotIconID);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&HHH",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
***************
*** 219,223 ****
  	PyMac_PRECHECK(GetIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "hl",
  	                      &theResID,
  	                      &selector))
--- 219,223 ----
  	PyMac_PRECHECK(GetIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "Hk",
  	                      &theResID,
  	                      &selector))
***************
*** 264,268 ****
  	PyMac_PRECHECK(PlotIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&hhO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
--- 264,268 ----
  	PyMac_PRECHECK(PlotIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&HHO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
***************
*** 291,295 ****
  	PyMac_PRECHECK(LoadIconCache);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&hhO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
--- 291,295 ----
  	PyMac_PRECHECK(LoadIconCache);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&HHO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
***************
*** 317,321 ****
  	PyMac_PRECHECK(GetLabel);
  #endif
! 	if (!PyArg_ParseTuple(_args, "hO&",
  	                      &labelNumber,
  	                      PyMac_GetStr255, labelString))
--- 317,321 ----
  	PyMac_PRECHECK(GetLabel);
  #endif
! 	if (!PyArg_ParseTuple(_args, "HO&",
  	                      &labelNumber,
  	                      PyMac_GetStr255, labelString))
***************
*** 341,345 ****
  	PyMac_PRECHECK(PtInIconID);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&hh",
  	                      PyMac_GetPoint, &testPt,
  	                      PyMac_GetRect, &iconRect,
--- 341,345 ----
  	PyMac_PRECHECK(PtInIconID);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&HH",
  	                      PyMac_GetPoint, &testPt,
  	                      PyMac_GetRect, &iconRect,
***************
*** 367,371 ****
  	PyMac_PRECHECK(PtInIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&hO&",
  	                      PyMac_GetPoint, &testPt,
  	                      PyMac_GetRect, &iconRect,
--- 367,371 ----
  	PyMac_PRECHECK(PtInIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&HO&",
  	                      PyMac_GetPoint, &testPt,
  	                      PyMac_GetRect, &iconRect,
***************
*** 393,397 ****
  	PyMac_PRECHECK(RectInIconID);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&hh",
  	                      PyMac_GetRect, &testRect,
  	                      PyMac_GetRect, &iconRect,
--- 393,397 ----
  	PyMac_PRECHECK(RectInIconID);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&HH",
  	                      PyMac_GetRect, &testRect,
  	                      PyMac_GetRect, &iconRect,
***************
*** 419,423 ****
  	PyMac_PRECHECK(RectInIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&hO&",
  	                      PyMac_GetRect, &testRect,
  	                      PyMac_GetRect, &iconRect,
--- 419,423 ----
  	PyMac_PRECHECK(RectInIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&HO&",
  	                      PyMac_GetRect, &testRect,
  	                      PyMac_GetRect, &iconRect,
***************
*** 445,449 ****
  	PyMac_PRECHECK(IconIDToRgn);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&hh",
  	                      ResObj_Convert, &theRgn,
  	                      PyMac_GetRect, &iconRect,
--- 445,449 ----
  	PyMac_PRECHECK(IconIDToRgn);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&HH",
  	                      ResObj_Convert, &theRgn,
  	                      PyMac_GetRect, &iconRect,
***************
*** 472,476 ****
  	PyMac_PRECHECK(IconSuiteToRgn);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&hO&",
  	                      ResObj_Convert, &theRgn,
  	                      PyMac_GetRect, &iconRect,
--- 472,476 ----
  	PyMac_PRECHECK(IconSuiteToRgn);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&HO&",
  	                      ResObj_Convert, &theRgn,
  	                      PyMac_GetRect, &iconRect,
***************
*** 497,501 ****
  	PyMac_PRECHECK(SetSuiteLabel);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&h",
  	                      ResObj_Convert, &theSuite,
  	                      &theLabel))
--- 497,501 ----
  	PyMac_PRECHECK(SetSuiteLabel);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&H",
  	                      ResObj_Convert, &theSuite,
  	                      &theLabel))
***************
*** 521,525 ****
  		return NULL;
  	_rv = GetSuiteLabel(theSuite);
! 	_res = Py_BuildValue("h",
  	                     _rv);
  	return _res;
--- 521,525 ----
  		return NULL;
  	_rv = GetSuiteLabel(theSuite);
! 	_res = Py_BuildValue("H",
  	                     _rv);
  	return _res;
***************
*** 537,541 ****
  	PyMac_PRECHECK(PlotIconHandle);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&hhO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
--- 537,541 ----
  	PyMac_PRECHECK(PlotIconHandle);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&HHO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
***************
*** 564,568 ****
  	PyMac_PRECHECK(PlotSICNHandle);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&hhO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
--- 564,568 ----
  	PyMac_PRECHECK(PlotSICNHandle);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&HHO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
***************
*** 591,595 ****
  	PyMac_PRECHECK(PlotCIconHandle);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&hhO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
--- 591,595 ----
  	PyMac_PRECHECK(PlotCIconHandle);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&HHO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
***************
*** 617,621 ****
  	PyMac_PRECHECK(IconRefToIconFamily);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&l",
  	                      ResObj_Convert, &theIconRef,
  	                      &whichIcons))
--- 617,621 ----
  	PyMac_PRECHECK(IconRefToIconFamily);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&k",
  	                      ResObj_Convert, &theIconRef,
  	                      &whichIcons))
***************
*** 640,644 ****
  	PyMac_PRECHECK(IconFamilyToIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&l",
  	                      ResObj_Convert, &iconFamily,
  	                      &whichIcons))
--- 640,644 ----
  	PyMac_PRECHECK(IconFamilyToIconSuite);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&k",
  	                      ResObj_Convert, &iconFamily,
  	                      &whichIcons))
***************
*** 663,667 ****
  	PyMac_PRECHECK(IconSuiteToIconFamily);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&l",
  	                      ResObj_Convert, &iconSuite,
  	                      &whichIcons))
--- 663,667 ----
  	PyMac_PRECHECK(IconSuiteToIconFamily);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&k",
  	                      ResObj_Convert, &iconSuite,
  	                      &whichIcons))
***************
*** 797,801 ****
  	                          &theLabel);
  	if (_err != noErr) return PyMac_Error(_err);
! 	_res = Py_BuildValue("O&h",
  	                     ResObj_New, theIconRef,
  	                     theLabel);
--- 797,801 ----
  	                          &theLabel);
  	if (_err != noErr) return PyMac_Error(_err);
! 	_res = Py_BuildValue("O&H",
  	                     ResObj_New, theIconRef,
  	                     theLabel);
***************
*** 814,818 ****
  	PyMac_PRECHECK(GetIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "hO&O&",
  	                      &vRefNum,
  	                      PyMac_GetOSType, &creator,
--- 814,818 ----
  	PyMac_PRECHECK(GetIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "HO&O&",
  	                      &vRefNum,
  	                      PyMac_GetOSType, &creator,
***************
*** 842,846 ****
  	PyMac_PRECHECK(GetIconRefFromFolder);
  #endif
! 	if (!PyArg_ParseTuple(_args, "hllbb",
  	                      &vRefNum,
  	                      &parentFolderID,
--- 842,846 ----
  	PyMac_PRECHECK(GetIconRefFromFolder);
  #endif
! 	if (!PyArg_ParseTuple(_args, "HllBB",
  	                      &vRefNum,
  	                      &parentFolderID,
***************
*** 899,903 ****
  	PyMac_PRECHECK(RegisterIconRefFromResource);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&O&h",
  	                      PyMac_GetOSType, &creator,
  	                      PyMac_GetOSType, &iconType,
--- 899,903 ----
  	PyMac_PRECHECK(RegisterIconRefFromResource);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&O&H",
  	                      PyMac_GetOSType, &creator,
  	                      PyMac_GetOSType, &iconType,
***************
*** 965,969 ****
  	PyMac_PRECHECK(OverrideIconRefFromResource);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&h",
  	                      ResObj_Convert, &theIconRef,
  	                      PyMac_GetFSSpec, &resourceFile,
--- 965,969 ----
  	PyMac_PRECHECK(OverrideIconRefFromResource);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&H",
  	                      ResObj_Convert, &theIconRef,
  	                      PyMac_GetFSSpec, &resourceFile,
***************
*** 1093,1097 ****
  	PyMac_PRECHECK(PlotIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&hhlO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
--- 1093,1097 ----
  	PyMac_PRECHECK(PlotIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&HHkO&",
  	                      PyMac_GetRect, &theRect,
  	                      &align,
***************
*** 1123,1127 ****
  	PyMac_PRECHECK(PtInIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&hlO&",
  	                      PyMac_GetPoint, &testPt,
  	                      PyMac_GetRect, &iconRect,
--- 1123,1127 ----
  	PyMac_PRECHECK(PtInIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&HkO&",
  	                      PyMac_GetPoint, &testPt,
  	                      PyMac_GetRect, &iconRect,
***************
*** 1152,1156 ****
  	PyMac_PRECHECK(RectInIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&hlO&",
  	                      PyMac_GetRect, &testRect,
  	                      PyMac_GetRect, &iconRect,
--- 1152,1156 ----
  	PyMac_PRECHECK(RectInIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&HkO&",
  	                      PyMac_GetRect, &testRect,
  	                      PyMac_GetRect, &iconRect,
***************
*** 1181,1185 ****
  	PyMac_PRECHECK(IconRefToRgn);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&hlO&",
  	                      ResObj_Convert, &theRgn,
  	                      PyMac_GetRect, &iconRect,
--- 1181,1185 ----
  	PyMac_PRECHECK(IconRefToRgn);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&O&HkO&",
  	                      ResObj_Convert, &theRgn,
  	                      PyMac_GetRect, &iconRect,
***************
*** 1210,1214 ****
  	PyMac_PRECHECK(GetIconSizesFromIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "llO&",
  	                      &iconSelectorInput,
  	                      &iconServicesUsageFlags,
--- 1210,1214 ----
  	PyMac_PRECHECK(GetIconSizesFromIconRef);
  #endif
! 	if (!PyArg_ParseTuple(_args, "kkO&",
  	                      &iconSelectorInput,
  	                      &iconServicesUsageFlags,
***************
*** 1220,1224 ****
  	                               theIconRef);
  	if (_err != noErr) return PyMac_Error(_err);
! 	_res = Py_BuildValue("l",
  	                     iconSelectorOutputPtr);
  	return _res;
--- 1220,1224 ----
  	                               theIconRef);
  	if (_err != noErr) return PyMac_Error(_err);
! 	_res = Py_BuildValue("k",
  	                     iconSelectorOutputPtr);
  	return _res;
***************
*** 1254,1258 ****
  	PyMac_PRECHECK(FlushIconRefsByVolume);
  #endif
! 	if (!PyArg_ParseTuple(_args, "h",
  	                      &vRefNum))
  		return NULL;
--- 1254,1258 ----
  	PyMac_PRECHECK(FlushIconRefsByVolume);
  #endif
! 	if (!PyArg_ParseTuple(_args, "H",
  	                      &vRefNum))
  		return NULL;
***************
*** 1273,1277 ****
  	PyMac_PRECHECK(SetCustomIconsEnabled);
  #endif
! 	if (!PyArg_ParseTuple(_args, "hb",
  	                      &vRefNum,
  	                      &enableCustomIcons))
--- 1273,1277 ----
  	PyMac_PRECHECK(SetCustomIconsEnabled);
  #endif
! 	if (!PyArg_ParseTuple(_args, "Hb",
  	                      &vRefNum,
  	                      &enableCustomIcons))
***************
*** 1294,1298 ****
  	PyMac_PRECHECK(GetCustomIconsEnabled);
  #endif
! 	if (!PyArg_ParseTuple(_args, "h",
  	                      &vRefNum))
  		return NULL;
--- 1294,1298 ----
  	PyMac_PRECHECK(GetCustomIconsEnabled);
  #endif
! 	if (!PyArg_ParseTuple(_args, "H",
  	                      &vRefNum))
  		return NULL;
***************
*** 1339,1343 ****
  	                        inVariant,
  	                        &outTransform);
! 	_res = Py_BuildValue("O&h",
  	                     ResObj_New, _rv,
  	                     outTransform);
--- 1339,1343 ----
  	                        inVariant,
  	                        &outTransform);
! 	_res = Py_BuildValue("O&H",
  	                     ResObj_New, _rv,
  	                     outTransform);

Index: icnsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/icn/icnsupport.py,v
retrieving revision 1.9
retrieving revision 1.9.6.1
diff -C2 -d -r1.9 -r1.9.6.1
*** icnsupport.py	3 Dec 2002 23:40:20 -0000	1.9
--- icnsupport.py	18 Apr 2003 08:58:44 -0000	1.9.6.1
***************
*** 28,35 ****
  IconFamilyHandle = OpaqueByValueType("IconFamilyHandle", "ResObj")
  RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
! IconAlignmentType = Type("IconAlignmentType", "h")
! IconTransformType = Type("IconTransformType", "h")
! IconSelectorValue = Type("IconSelectorValue", "l")
! IconServicesUsageFlags = Type("IconServicesUsageFlags", "l")
  RGBColor = OpaqueType("RGBColor", "QdRGB")
  
--- 28,35 ----
  IconFamilyHandle = OpaqueByValueType("IconFamilyHandle", "ResObj")
  RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
! IconAlignmentType = Type("IconAlignmentType", "H")
! IconTransformType = Type("IconTransformType", "H")
! IconSelectorValue = Type("IconSelectorValue", "k")
! IconServicesUsageFlags = Type("IconServicesUsageFlags", "k")
  RGBColor = OpaqueType("RGBColor", "QdRGB")