[Python-checkins] CVS: python/dist/src/Mac/Modules/carbonevt CarbonEvtsupport.py,1.1,1.2

Jack Jansen jackjansen@users.sourceforge.net
Mon, 05 Nov 2001 08:15:47 -0800


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

Modified Files:
	CarbonEvtsupport.py 
Log Message:
Fixed broken newlines and changed module name. Still untested.

Index: CarbonEvtsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/CarbonEvtsupport.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CarbonEvtsupport.py	2001/11/05 14:44:23	1.1
--- CarbonEvtsupport.py	2001/11/05 16:15:45	1.2
***************
*** 127,132 ****
  /******** handlecommand ***********/
  
! pascal OSStatus CarbonEvents_HandleCommand(EventHandlerCallRef handlerRef, Even
! tRef event, void *outPyObject) {
  	PyObject *retValue;
  	int status;
--- 127,131 ----
  /******** handlecommand ***********/
  
! pascal OSStatus CarbonEvents_HandleCommand(EventHandlerCallRef handlerRef, EventRef event, void *outPyObject) {
  	PyObject *retValue;
  	int status;
***************
*** 137,142 ****
  #endif /* USE_MAC_MP_MULTITHREADING */
  
!     retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&", EventHand
! lerCallRef_New, handlerRef, EventRef_New, event);
      status = PyInt_AsLong(retValue);
  
--- 136,140 ----
  #endif /* USE_MAC_MP_MULTITHREADING */
  
!     retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&", EventHandlerCallRef_New, handlerRef, EventRef_New, event);
      status = PyInt_AsLong(retValue);
  
***************
*** 153,158 ****
  """
  
! module = MacModule('CarbonEvents', 'CarbonEvents', includestuff, finalstuff, in
! itstuff)
  
  #class CFReleaserObj(GlobalObjectDefinition):
--- 151,155 ----
  """
  
! module = MacModule('CarbonEvents', 'CarbonEvents', includestuff, finalstuff, initstuff)
  
  #class CFReleaserObj(GlobalObjectDefinition):
***************
*** 166,171 ****
  
  functions = []
! for typ in RefObjectTypes: ## go thru all ObjectTypes as defined in CarbonEvent
! sscan.py
  	# initialize the lists for carbongen to fill
  	execstr = typ + 'methods = []'
--- 163,167 ----
  
  functions = []
! for typ in RefObjectTypes: ## go thru all ObjectTypes as defined in CarbonEventsscan.py
  	# initialize the lists for carbongen to fill
  	execstr = typ + 'methods = []'
***************
*** 174,188 ****
  execfile('CarbonEventsgen.py')
  
! for f in functions: module.add(f)	# add all the functions carboneventsgen
!  put in the list
  
! for typ in RefObjectTypes:				 ## go thru all ObjectT
! ypes as defined in CarbonEventsscan.py
  	methods = eval(typ + 'methods')  ## get a reference to the method list 
  from the main namespace
! 	obj = eval(typ + 'object')		  ## get a reference to the obj
! ect
! 	for m in methods: obj.add(m)	## add each method in the list to the o
! bject
  
  installeventhandler = """
--- 170,180 ----
  execfile('CarbonEventsgen.py')
  
! for f in functions: module.add(f)	# add all the functions carboneventsgen put in the list
  
! for typ in RefObjectTypes:				 ## go thru all ObjectTypes as defined in CarbonEventsscan.py
  	methods = eval(typ + 'methods')  ## get a reference to the method list 
  from the main namespace
! 	obj = eval(typ + 'object')		  ## get a reference to the object
! 	for m in methods: obj.add(m)	## add each method in the list to the object
  
  installeventhandler = """
***************
*** 197,202 ****
  
  event = NewEventHandlerUPP(CarbonEvents_HandleCommand);
! _err = InstallEventHandler(_self->ob_itself, event, 1, &inSpec, (void *)callbac
! k, &outRef);
  if (_err != noErr) return PyMac_Error(_err);
  
--- 189,193 ----
  
  event = NewEventHandlerUPP(CarbonEvents_HandleCommand);
! _err = InstallEventHandler(_self->ob_itself, event, 1, &inSpec, (void *)callback, &outRef);
  if (_err != noErr) return PyMac_Error(_err);
  
***************
*** 205,210 ****
  
  f = ManualGenerator("InstallEventHandler", installeventhandler);
! f.docstring = lambda: "(EventTargetRef inTarget, EventTypeSpec inSpec, Method c
! allback) -> (EventHandlerRef outRef)"
  EventTargetRefobject.add(f)
  
--- 196,200 ----
  
  f = ManualGenerator("InstallEventHandler", installeventhandler);
! f.docstring = lambda: "(EventTargetRef inTarget, EventTypeSpec inSpec, Method callback) -> (EventHandlerRef outRef)"
  EventTargetRefobject.add(f)
  
***************
*** 235,239 ****
  module.add(f)
  
! SetOutputFileName('_CarbonEvents.c')
  module.generate()
  
--- 225,229 ----
  module.add(f)
  
! SetOutputFileName('_CarbonEvt.c')
  module.generate()