[Python-checkins] python/dist/src/Mac/Modules/carbonevt CarbonEvtsupport.py,1.13,1.13.6.1 _CarbonEvtmodule.c,1.14,1.14.6.1

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


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

Modified Files:
      Tag: getargs_mask_mods
	CarbonEvtsupport.py _CarbonEvtmodule.c 
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: CarbonEvtsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/CarbonEvtsupport.py,v
retrieving revision 1.13
retrieving revision 1.13.6.1
diff -C2 -d -r1.13 -r1.13.6.1
*** CarbonEvtsupport.py	23 Dec 2002 23:16:21 -0000	1.13
--- CarbonEvtsupport.py	18 Apr 2003 08:58:33 -0000	1.13.6.1
***************
*** 117,121 ****
  EventTypeSpec_Convert(PyObject *v, EventTypeSpec *out)
  {
! 	if (PyArg_Parse(v, "(O&l)",
  	                PyMac_GetOSType, &(out->eventClass),
  	                &(out->eventKind)))
--- 117,121 ----
  EventTypeSpec_Convert(PyObject *v, EventTypeSpec *out)
  {
! 	if (PyArg_Parse(v, "(O&k)",
  	                PyMac_GetOSType, &(out->eventClass),
  	                &(out->eventKind)))
***************
*** 157,161 ****
  EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out)
  {
! 	if (PyArg_ParseTuple(v, "ll", &out->signature, &out->id))
  		return 1;
  	return NULL;
--- 157,161 ----
  EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out)
  {
! 	if (PyArg_ParseTuple(v, "kk", &out->signature, &out->id))
  		return 1;
  	return NULL;

Index: _CarbonEvtmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/_CarbonEvtmodule.c,v
retrieving revision 1.14
retrieving revision 1.14.6.1
diff -C2 -d -r1.14 -r1.14.6.1
*** _CarbonEvtmodule.c	23 Dec 2002 23:16:21 -0000	1.14
--- _CarbonEvtmodule.c	18 Apr 2003 08:58:33 -0000	1.14.6.1
***************
*** 48,52 ****
  EventTypeSpec_Convert(PyObject *v, EventTypeSpec *out)
  {
! 	if (PyArg_Parse(v, "(O&l)",
  	                PyMac_GetOSType, &(out->eventClass),
  	                &(out->eventKind)))
--- 48,52 ----
  EventTypeSpec_Convert(PyObject *v, EventTypeSpec *out)
  {
! 	if (PyArg_Parse(v, "(O&k)",
  	                PyMac_GetOSType, &(out->eventClass),
  	                &(out->eventKind)))
***************
*** 88,92 ****
  EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out)
  {
! 	if (PyArg_ParseTuple(v, "ll", &out->signature, &out->id))
  		return 1;
  	return NULL;
--- 88,92 ----
  EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out)
  {
! 	if (PyArg_ParseTuple(v, "kk", &out->signature, &out->id))
  		return 1;
  	return NULL;
***************
*** 194,198 ****
  		return NULL;
  	_rv = GetEventRetainCount(_self->ob_itself);
! 	_res = Py_BuildValue("l",
  	                     _rv);
  	return _res;
--- 194,198 ----
  		return NULL;
  	_rv = GetEventRetainCount(_self->ob_itself);
! 	_res = Py_BuildValue("k",
  	                     _rv);
  	return _res;
***************
*** 242,246 ****
  		return NULL;
  	_rv = GetEventClass(_self->ob_itself);
! 	_res = Py_BuildValue("l",
  	                     _rv);
  	return _res;
--- 242,246 ----
  		return NULL;
  	_rv = GetEventClass(_self->ob_itself);
! 	_res = Py_BuildValue("k",
  	                     _rv);
  	return _res;
***************
*** 254,258 ****
  		return NULL;
  	_rv = GetEventKind(_self->ob_itself);
! 	_res = Py_BuildValue("l",
  	                     _rv);
  	return _res;
--- 254,258 ----
  		return NULL;
  	_rv = GetEventKind(_self->ob_itself);
! 	_res = Py_BuildValue("k",
  	                     _rv);
  	return _res;
***************
*** 525,529 ****
  	EventRef inEvent;
  	SInt16 inPriority;
! 	if (!PyArg_ParseTuple(_args, "O&h",
  	                      EventRef_Convert, &inEvent,
  	                      &inPriority))
--- 525,529 ----
  	EventRef inEvent;
  	SInt16 inPriority;
! 	if (!PyArg_ParseTuple(_args, "O&H",
  	                      EventRef_Convert, &inEvent,
  	                      &inPriority))
***************
*** 544,548 ****
  	UInt32 inNumTypes;
  	EventTypeSpec inList;
! 	if (!PyArg_ParseTuple(_args, "lO&",
  	                      &inNumTypes,
  	                      EventTypeSpec_Convert, &inList))
--- 544,548 ----
  	UInt32 inNumTypes;
  	EventTypeSpec inList;
! 	if (!PyArg_ParseTuple(_args, "kO&",
  	                      &inNumTypes,
  	                      EventTypeSpec_Convert, &inList))
***************
*** 577,581 ****
  		return NULL;
  	_rv = GetNumEventsInQueue(_self->ob_itself);
! 	_res = Py_BuildValue("l",
  	                     _rv);
  	return _res;
--- 577,581 ----
  		return NULL;
  	_rv = GetNumEventsInQueue(_self->ob_itself);
! 	_res = Py_BuildValue("k",
  	                     _rv);
  	return _res;
***************
*** 1030,1034 ****
  		return NULL;
  	}
! 	if (!PyArg_ParseTuple(_args, "lO&",
  	                      &inNumTypes,
  	                      EventTypeSpec_Convert, &inList))
--- 1030,1034 ----
  		return NULL;
  	}
! 	if (!PyArg_ParseTuple(_args, "kO&",
  	                      &inNumTypes,
  	                      EventTypeSpec_Convert, &inList))
***************
*** 1053,1057 ****
  		return NULL;
  	}
! 	if (!PyArg_ParseTuple(_args, "lO&",
  	                      &inNumTypes,
  	                      EventTypeSpec_Convert, &inList))
--- 1053,1057 ----
  		return NULL;
  	}
! 	if (!PyArg_ParseTuple(_args, "kO&",
  	                      &inNumTypes,
  	                      EventTypeSpec_Convert, &inList))
***************
*** 1634,1638 ****
  	Boolean inPullEvent;
  	EventRef outEvent;
! 	if (!PyArg_ParseTuple(_args, "lO&db",
  	                      &inNumTypes,
  	                      EventTypeSpec_Convert, &inList,
--- 1634,1638 ----
  	Boolean inPullEvent;
  	EventRef outEvent;
! 	if (!PyArg_ParseTuple(_args, "kO&db",
  	                      &inNumTypes,
  	                      EventTypeSpec_Convert, &inList,
***************
*** 1717,1721 ****
  	UInt32 outModifiers;
  	UInt16 outResult;
! 	if (!PyArg_ParseTuple(_args, "O&ld",
  	                      GrafObj_Convert, &inPort,
  	                      &inOptions,
--- 1717,1721 ----
  	UInt32 outModifiers;
  	UInt16 outResult;
! 	if (!PyArg_ParseTuple(_args, "O&kd",
  	                      GrafObj_Convert, &inPort,
  	                      &inOptions,
***************
*** 1729,1733 ****
  	                                     &outResult);
  	if (_err != noErr) return PyMac_Error(_err);
! 	_res = Py_BuildValue("O&lH",
  	                     PyMac_BuildPoint, outPt,
  	                     outModifiers,
--- 1729,1733 ----
  	                                     &outResult);
  	if (_err != noErr) return PyMac_Error(_err);
! 	_res = Py_BuildValue("O&kH",
  	                     PyMac_BuildPoint, outPt,
  	                     outModifiers,
***************
*** 2028,2032 ****
  	OptionBits inOptions;
  	EventHotKeyRef outRef;
! 	if (!PyArg_ParseTuple(_args, "llO&O&l",
  	                      &inHotKeyCode,
  	                      &inHotKeyModifiers,
--- 2028,2032 ----
  	OptionBits inOptions;
  	EventHotKeyRef outRef;
! 	if (!PyArg_ParseTuple(_args, "kkO&O&k",
  	                      &inHotKeyCode,
  	                      &inHotKeyModifiers,