[Python-checkins] CVS: python/dist/src/Mac/Modules/evt _Evtmodule.c,1.3,1.3.2.1 evtedit.py,1.1,1.1.18.1 evtsupport.py,1.13,1.13.10.1

Jack Jansen jackjansen@users.sourceforge.net
Wed, 19 Dec 2001 07:10:47 -0800


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

Modified Files:
      Tag: r22rc1-branch
	_Evtmodule.c evtedit.py evtsupport.py 
Log Message:
Merged Mac subtree into the 22c1 branch.


Index: _Evtmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/evt/_Evtmodule.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** _Evtmodule.c	2001/11/30 14:16:32	1.3
--- _Evtmodule.c	2001/12/19 15:10:15	1.3.2.1
***************
*** 6,11 ****
--- 6,15 ----
  
  
+ #ifdef _WIN32
+ #include "pywintoolbox.h"
+ #else
  #include "macglue.h"
  #include "pymactoolbox.h"
+ #endif
  
  /* Macro to test whether a weak-loaded CFM function exists */
***************
*** 74,89 ****
  }
  
- static PyObject *Evt_TickCount(PyObject *_self, PyObject *_args)
- {
- 	PyObject *_res = NULL;
- 	UInt32 _rv;
- 	if (!PyArg_ParseTuple(_args, ""))
- 		return NULL;
- 	_rv = TickCount();
- 	_res = Py_BuildValue("l",
- 	                     _rv);
- 	return _res;
- }
- 
  static PyObject *Evt_GetCaretTime(PyObject *_self, PyObject *_args)
  {
--- 78,81 ----
***************
*** 338,341 ****
--- 330,475 ----
  #endif
  
+ static PyObject *Evt_KeyScript(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	short code;
+ 	if (!PyArg_ParseTuple(_args, "h",
+ 	                      &code))
+ 		return NULL;
+ 	KeyScript(code);
+ 	Py_INCREF(Py_None);
+ 	_res = Py_None;
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_IsCmdChar(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	Boolean _rv;
+ 	EventRecord event;
+ 	short test;
+ 	if (!PyArg_ParseTuple(_args, "O&h",
+ 	                      PyMac_GetEventRecord, &event,
+ 	                      &test))
+ 		return NULL;
+ 	_rv = IsCmdChar(&event,
+ 	                test);
+ 	_res = Py_BuildValue("b",
+ 	                     _rv);
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_LMGetKeyThresh(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	SInt16 _rv;
+ 	if (!PyArg_ParseTuple(_args, ""))
+ 		return NULL;
+ 	_rv = LMGetKeyThresh();
+ 	_res = Py_BuildValue("h",
+ 	                     _rv);
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_LMSetKeyThresh(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	SInt16 value;
+ 	if (!PyArg_ParseTuple(_args, "h",
+ 	                      &value))
+ 		return NULL;
+ 	LMSetKeyThresh(value);
+ 	Py_INCREF(Py_None);
+ 	_res = Py_None;
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_LMGetKeyRepThresh(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	SInt16 _rv;
+ 	if (!PyArg_ParseTuple(_args, ""))
+ 		return NULL;
+ 	_rv = LMGetKeyRepThresh();
+ 	_res = Py_BuildValue("h",
+ 	                     _rv);
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_LMSetKeyRepThresh(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	SInt16 value;
+ 	if (!PyArg_ParseTuple(_args, "h",
+ 	                      &value))
+ 		return NULL;
+ 	LMSetKeyRepThresh(value);
+ 	Py_INCREF(Py_None);
+ 	_res = Py_None;
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_LMGetKbdLast(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	UInt8 _rv;
+ 	if (!PyArg_ParseTuple(_args, ""))
+ 		return NULL;
+ 	_rv = LMGetKbdLast();
+ 	_res = Py_BuildValue("b",
+ 	                     _rv);
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_LMSetKbdLast(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	UInt8 value;
+ 	if (!PyArg_ParseTuple(_args, "b",
+ 	                      &value))
+ 		return NULL;
+ 	LMSetKbdLast(value);
+ 	Py_INCREF(Py_None);
+ 	_res = Py_None;
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_LMGetKbdType(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	UInt8 _rv;
+ 	if (!PyArg_ParseTuple(_args, ""))
+ 		return NULL;
+ 	_rv = LMGetKbdType();
+ 	_res = Py_BuildValue("b",
+ 	                     _rv);
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_LMSetKbdType(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	UInt8 value;
+ 	if (!PyArg_ParseTuple(_args, "b",
+ 	                      &value))
+ 		return NULL;
+ 	LMSetKbdType(value);
+ 	Py_INCREF(Py_None);
+ 	_res = Py_None;
+ 	return _res;
+ }
+ 
+ static PyObject *Evt_TickCount(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	UInt32 _rv;
+ 	if (!PyArg_ParseTuple(_args, ""))
+ 		return NULL;
+ 	_rv = TickCount();
+ 	_res = Py_BuildValue("l",
+ 	                     _rv);
+ 	return _res;
+ }
+ 
  static PyObject *Evt_WaitNextEvent(PyObject *_self, PyObject *_args)
  {
***************
*** 373,378 ****
  	{"WaitMouseUp", (PyCFunction)Evt_WaitMouseUp, 1,
  	 "() -> (Boolean _rv)"},
- 	{"TickCount", (PyCFunction)Evt_TickCount, 1,
- 	 "() -> (UInt32 _rv)"},
  	{"GetCaretTime", (PyCFunction)Evt_GetCaretTime, 1,
  	 "() -> (UInt32 _rv)"},
--- 507,510 ----
***************
*** 431,434 ****
--- 563,588 ----
  	 "() -> (Boolean _rv)"},
  #endif
+ 	{"KeyScript", (PyCFunction)Evt_KeyScript, 1,
+ 	 "(short code) -> None"},
+ 	{"IsCmdChar", (PyCFunction)Evt_IsCmdChar, 1,
+ 	 "(EventRecord event, short test) -> (Boolean _rv)"},
+ 	{"LMGetKeyThresh", (PyCFunction)Evt_LMGetKeyThresh, 1,
+ 	 "() -> (SInt16 _rv)"},
+ 	{"LMSetKeyThresh", (PyCFunction)Evt_LMSetKeyThresh, 1,
+ 	 "(SInt16 value) -> None"},
+ 	{"LMGetKeyRepThresh", (PyCFunction)Evt_LMGetKeyRepThresh, 1,
+ 	 "() -> (SInt16 _rv)"},
+ 	{"LMSetKeyRepThresh", (PyCFunction)Evt_LMSetKeyRepThresh, 1,
+ 	 "(SInt16 value) -> None"},
+ 	{"LMGetKbdLast", (PyCFunction)Evt_LMGetKbdLast, 1,
+ 	 "() -> (UInt8 _rv)"},
+ 	{"LMSetKbdLast", (PyCFunction)Evt_LMSetKbdLast, 1,
+ 	 "(UInt8 value) -> None"},
+ 	{"LMGetKbdType", (PyCFunction)Evt_LMGetKbdType, 1,
+ 	 "() -> (UInt8 _rv)"},
+ 	{"LMSetKbdType", (PyCFunction)Evt_LMSetKbdType, 1,
+ 	 "(UInt8 value) -> None"},
+ 	{"TickCount", (PyCFunction)Evt_TickCount, 1,
+ 	 "() -> (UInt32 _rv)"},
  	{"WaitNextEvent", (PyCFunction)Evt_WaitNextEvent, 1,
  	 "(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"},

Index: evtedit.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/evt/evtedit.py,v
retrieving revision 1.1
retrieving revision 1.1.18.1
diff -C2 -d -r1.1 -r1.1.18.1
*** evtedit.py	1995/03/10 14:46:39	1.1
--- evtedit.py	2001/12/19 15:10:15	1.1.18.1
***************
*** 5,6 ****
--- 5,10 ----
  functions.append(f)
  
+ f = Function(UInt32, 'TickCount',
+ )
+ functions.append(f)
+ 

Index: evtsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/evt/evtsupport.py,v
retrieving revision 1.13
retrieving revision 1.13.10.1
diff -C2 -d -r1.13 -r1.13.10.1
*** evtsupport.py	2001/08/23 13:48:34	1.13
--- evtsupport.py	2001/12/19 15:10:15	1.13.10.1
***************
*** 73,76 ****
--- 73,81 ----
  execfile(INPUTFILE)
  
+ # Move TickCount here, for convenience
+ f = Function(UInt32, 'TickCount',
+ )
+ functions.append(f)
+ 
  # add the populated lists to the generator groups
  # (in a different wordl the scan program would generate this)
***************
*** 102,105 ****
--- 107,111 ----
  f.docstring = lambda: "(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"
  module.add(f)
+ 
  
  # generate output (open the output file as late as possible)