[Python-checkins] CVS: python/dist/src/Mac/Modules/ae aesupport.py,1.20,1.21

Jack Jansen jackjansen@users.sourceforge.net
Wed, 20 Jun 2001 13:53:40 -0700


Update of /cvsroot/python/python/dist/src/Mac/Modules/ae
In directory usw-pr-cvs1:/tmp/cvs-serv24669/MacPython/Mac/Modules/ae

Modified Files:
	aesupport.py 
Log Message:
Adapted to Universal Headers 3.4: new refcontype and use UPP names in stead of Proc names for callback creation.

Index: aesupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ae/aesupport.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** aesupport.py	2001/05/22 21:51:00	1.20
--- aesupport.py	2001/06/20 20:53:38	1.21
***************
*** 117,122 ****
  
  finalstuff = finalstuff + """
  static pascal OSErr
! GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long refcon)
  {
  	PyObject *handler = (PyObject *)refcon;
--- 117,128 ----
  
  finalstuff = finalstuff + """
+ #if UNIVERSAL_INTERFACES_VERSION >= 0x0340
+ typedef long refcontype;
+ #else
+ typedef unsigned long refcontype;
+ #endif
+ 
  static pascal OSErr
! GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon)
  {
  	PyObject *handler = (PyObject *)refcon;
***************
*** 150,154 ****
--- 156,164 ----
  initstuff = initstuff + """
  	upp_AEIdleProc = NewAEIdleUPP(AEIdleProc);
+ #if UNIVERSAL_INTERFACES_VERSION >= 0x0340
+ 	upp_GenericEventHandler = NewAEEventHandlerUPP(&GenericEventHandler);
+ #else
  	upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler);
+ #endif
  	PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New);
  	PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert);