[Python-checkins] python/dist/src/Mac/Modules/drag _Dragmodule.c,1.14,1.14.6.1 dragsupport.py,1.12,1.12.6.1
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
Fri, 18 Apr 2003 01:59:12 -0700
Update of /cvsroot/python/python/dist/src/Mac/Modules/drag
In directory sc8-pr-cvs1:/tmp/cvs-serv28363/Mac/Modules/drag
Modified Files:
Tag: getargs_mask_mods
_Dragmodule.c dragsupport.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: _Dragmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/drag/_Dragmodule.c,v
retrieving revision 1.14
retrieving revision 1.14.6.1
diff -C2 -d -r1.14 -r1.14.6.1
*** _Dragmodule.c 23 Dec 2002 23:16:22 -0000 1.14
--- _Dragmodule.c 18 Apr 2003 08:58:38 -0000 1.14.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)
***************
*** 117,121 ****
PyMac_PRECHECK(AddDragItemFlavor);
#endif
! if (!PyArg_ParseTuple(_args, "lO&z#l",
&theItemRef,
PyMac_GetOSType, &theType,
--- 117,121 ----
PyMac_PRECHECK(AddDragItemFlavor);
#endif
! if (!PyArg_ParseTuple(_args, "kO&z#k",
&theItemRef,
PyMac_GetOSType, &theType,
***************
*** 148,152 ****
PyMac_PRECHECK(SetDragItemFlavorData);
#endif
! if (!PyArg_ParseTuple(_args, "lO&z#l",
&theItemRef,
PyMac_GetOSType, &theType,
--- 148,152 ----
PyMac_PRECHECK(SetDragItemFlavorData);
#endif
! if (!PyArg_ParseTuple(_args, "kO&z#k",
&theItemRef,
PyMac_GetOSType, &theType,
***************
*** 177,181 ****
PyMac_PRECHECK(SetDragImage);
#endif
! if (!PyArg_ParseTuple(_args, "O&O&O&l",
ResObj_Convert, &imagePixMap,
ResObj_Convert, &imageRgn,
--- 177,181 ----
PyMac_PRECHECK(SetDragImage);
#endif
! if (!PyArg_ParseTuple(_args, "O&O&O&k",
ResObj_Convert, &imagePixMap,
ResObj_Convert, &imageRgn,
***************
*** 203,207 ****
PyMac_PRECHECK(ChangeDragBehaviors);
#endif
! if (!PyArg_ParseTuple(_args, "ll",
&inBehaviorsToSet,
&inBehaviorsToClear))
--- 203,207 ----
PyMac_PRECHECK(ChangeDragBehaviors);
#endif
! if (!PyArg_ParseTuple(_args, "kk",
&inBehaviorsToSet,
&inBehaviorsToClear))
***************
*** 272,276 ****
&theItemRef);
if (_err != noErr) return PyMac_Error(_err);
! _res = Py_BuildValue("l",
theItemRef);
return _res;
--- 272,276 ----
&theItemRef);
if (_err != noErr) return PyMac_Error(_err);
! _res = Py_BuildValue("k",
theItemRef);
return _res;
***************
*** 286,290 ****
PyMac_PRECHECK(CountDragItemFlavors);
#endif
! if (!PyArg_ParseTuple(_args, "l",
&theItemRef))
return NULL;
--- 286,290 ----
PyMac_PRECHECK(CountDragItemFlavors);
#endif
! if (!PyArg_ParseTuple(_args, "k",
&theItemRef))
return NULL;
***************
*** 308,312 ****
PyMac_PRECHECK(GetFlavorType);
#endif
! if (!PyArg_ParseTuple(_args, "lH",
&theItemRef,
&index))
--- 308,312 ----
PyMac_PRECHECK(GetFlavorType);
#endif
! if (!PyArg_ParseTuple(_args, "kH",
&theItemRef,
&index))
***************
*** 332,336 ****
PyMac_PRECHECK(GetFlavorFlags);
#endif
! if (!PyArg_ParseTuple(_args, "lO&",
&theItemRef,
PyMac_GetOSType, &theType))
--- 332,336 ----
PyMac_PRECHECK(GetFlavorFlags);
#endif
! if (!PyArg_ParseTuple(_args, "kO&",
&theItemRef,
PyMac_GetOSType, &theType))
***************
*** 341,345 ****
&theFlags);
if (_err != noErr) return PyMac_Error(_err);
! _res = Py_BuildValue("l",
theFlags);
return _res;
--- 341,345 ----
&theFlags);
if (_err != noErr) return PyMac_Error(_err);
! _res = Py_BuildValue("k",
theFlags);
return _res;
***************
*** 356,360 ****
PyMac_PRECHECK(GetFlavorDataSize);
#endif
! if (!PyArg_ParseTuple(_args, "lO&",
&theItemRef,
PyMac_GetOSType, &theType))
--- 356,360 ----
PyMac_PRECHECK(GetFlavorDataSize);
#endif
! if (!PyArg_ParseTuple(_args, "kO&",
&theItemRef,
PyMac_GetOSType, &theType))
***************
*** 383,387 ****
PyMac_PRECHECK(GetFlavorData);
#endif
! if (!PyArg_ParseTuple(_args, "lO&il",
&theItemRef,
PyMac_GetOSType, &theType,
--- 383,387 ----
PyMac_PRECHECK(GetFlavorData);
#endif
! if (!PyArg_ParseTuple(_args, "kO&ik",
&theItemRef,
PyMac_GetOSType, &theType,
***************
*** 417,421 ****
PyMac_PRECHECK(GetDragItemBounds);
#endif
! if (!PyArg_ParseTuple(_args, "l",
&theItemRef))
return NULL;
--- 417,421 ----
PyMac_PRECHECK(GetDragItemBounds);
#endif
! if (!PyArg_ParseTuple(_args, "k",
&theItemRef))
return NULL;
***************
*** 438,442 ****
PyMac_PRECHECK(SetDragItemBounds);
#endif
! if (!PyArg_ParseTuple(_args, "lO&",
&theItemRef,
PyMac_GetRect, &itemBounds))
--- 438,442 ----
PyMac_PRECHECK(SetDragItemBounds);
#endif
! if (!PyArg_ParseTuple(_args, "kO&",
&theItemRef,
PyMac_GetRect, &itemBounds))
***************
*** 501,505 ****
&flags);
if (_err != noErr) return PyMac_Error(_err);
! _res = Py_BuildValue("l",
flags);
return _res;
--- 501,505 ----
&flags);
if (_err != noErr) return PyMac_Error(_err);
! _res = Py_BuildValue("k",
flags);
return _res;
***************
*** 581,585 ****
&mouseUpModifiers);
if (_err != noErr) return PyMac_Error(_err);
! _res = Py_BuildValue("hhh",
modifiers,
mouseDownModifiers,
--- 581,585 ----
&mouseUpModifiers);
if (_err != noErr) return PyMac_Error(_err);
! _res = Py_BuildValue("HHH",
modifiers,
mouseDownModifiers,
***************
*** 635,639 ****
PyMac_PRECHECK(DragPreScroll);
#endif
! if (!PyArg_ParseTuple(_args, "hh",
&dH,
&dV))
--- 635,639 ----
PyMac_PRECHECK(DragPreScroll);
#endif
! if (!PyArg_ParseTuple(_args, "HH",
&dH,
&dV))
***************
*** 880,884 ****
PyMac_PRECHECK(ZoomRects);
#endif
! if (!PyArg_ParseTuple(_args, "O&O&hh",
PyMac_GetRect, &fromRect,
PyMac_GetRect, &toRect,
--- 880,884 ----
PyMac_PRECHECK(ZoomRects);
#endif
! if (!PyArg_ParseTuple(_args, "O&O&Hh",
PyMac_GetRect, &fromRect,
PyMac_GetRect, &toRect,
***************
*** 907,911 ****
PyMac_PRECHECK(ZoomRegion);
#endif
! if (!PyArg_ParseTuple(_args, "O&O&hh",
ResObj_Convert, ®ion,
PyMac_GetPoint, &zoomDistance,
--- 907,911 ----
PyMac_PRECHECK(ZoomRegion);
#endif
! if (!PyArg_ParseTuple(_args, "O&O&Hh",
ResObj_Convert, ®ion,
PyMac_GetPoint, &zoomDistance,
***************
*** 1040,1044 ****
i = 0;
else
! PyArg_Parse(rv, "l", &i);
Py_DECREF(rv);
return i;
--- 1040,1044 ----
i = 0;
else
! PyArg_Parse(rv, "k", &i);
Py_DECREF(rv);
return i;
***************
*** 1066,1070 ****
i = 0;
else
! PyArg_Parse(rv, "l", &i);
Py_DECREF(rv);
return i;
--- 1066,1070 ----
i = 0;
else
! PyArg_Parse(rv, "k", &i);
Py_DECREF(rv);
return i;
***************
*** 1095,1099 ****
i = 0;
else
! PyArg_Parse(rv, "l", &i);
Py_DECREF(rv);
return i;
--- 1095,1099 ----
i = 0;
else
! PyArg_Parse(rv, "k", &i);
Py_DECREF(rv);
return i;
Index: dragsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/drag/dragsupport.py,v
retrieving revision 1.12
retrieving revision 1.12.6.1
diff -C2 -d -r1.12 -r1.12.6.1
*** dragsupport.py 3 Dec 2002 23:40:20 -0000 1.12
--- dragsupport.py 18 Apr 2003 08:58:38 -0000 1.12.6.1
***************
*** 23,27 ****
DragRef = OpaqueByValueType(OBJECTTYPE, OBJECTPREFIX)
! DragItemRef = Type("ItemReference", "l")
# Old names
DragReference = DragRef
--- 23,27 ----
DragRef = OpaqueByValueType(OBJECTTYPE, OBJECTPREFIX)
! DragItemRef = Type("ItemReference", "k")
# Old names
DragReference = DragRef
***************
*** 35,45 ****
FlavorType = OSTypeType("FlavorType")
! DragAttributes = Type("DragAttributes", "l")
! DragBehaviors = Type("DragBehaviors", "l")
! DragImageFlags = Type("DragImageFlags", "l")
! DragImageTranslucency = Type("DragImageTranslucency", "l")
DragRegionMessage = Type("DragRegionMessage", "h")
ZoomAcceleration = Type("ZoomAcceleration", "h")
! FlavorFlags = Type("FlavorFlags", "l")
DragTrackingMessage = Type("DragTrackingMessage", "h")
--- 35,45 ----
FlavorType = OSTypeType("FlavorType")
! DragAttributes = Type("DragAttributes", "k")
! DragBehaviors = Type("DragBehaviors", "k")
! DragImageFlags = Type("DragImageFlags", "k")
! DragImageTranslucency = Type("DragImageTranslucency", "k")
DragRegionMessage = Type("DragRegionMessage", "h")
ZoomAcceleration = Type("ZoomAcceleration", "h")
! FlavorFlags = Type("FlavorFlags", "k")
DragTrackingMessage = Type("DragTrackingMessage", "h")
***************
*** 91,95 ****
i = 0;
else
! PyArg_Parse(rv, "l", &i);
Py_DECREF(rv);
return i;
--- 91,95 ----
i = 0;
else
! PyArg_Parse(rv, "k", &i);
Py_DECREF(rv);
return i;
***************
*** 117,121 ****
i = 0;
else
! PyArg_Parse(rv, "l", &i);
Py_DECREF(rv);
return i;
--- 117,121 ----
i = 0;
else
! PyArg_Parse(rv, "k", &i);
Py_DECREF(rv);
return i;
***************
*** 146,150 ****
i = 0;
else
! PyArg_Parse(rv, "l", &i);
Py_DECREF(rv);
return i;
--- 146,150 ----
i = 0;
else
! PyArg_Parse(rv, "k", &i);
Py_DECREF(rv);
return i;