Update of /cvsroot/python/python/dist/src/Mac/Modules/carbonevt In directory usw-pr-cvs1:/tmp/cvs-serv29357 Modified Files: CarbonEvtscan.py CarbonEvtsupport.py _CarbonEvtmodule.c Log Message: Today's Carbon Toolbox addition: CarbonEvt.TrackMouseLocation() and friends. Index: CarbonEvtscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/CarbonEvtscan.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CarbonEvtscan.py 2002/01/03 20:45:47 1.5 --- CarbonEvtscan.py 2002/01/08 11:49:31 1.6 *************** *** 64,70 **** "sHandler", "MacCreateEvent", ! "TrackMouseLocationWithOptions", ! "TrackMouseLocation", ! "TrackMouseRegion", "RegisterToolboxObjectClass", "UnregisterToolboxObjectClass", --- 64,70 ---- "sHandler", "MacCreateEvent", ! # "TrackMouseLocationWithOptions", ! # "TrackMouseLocation", ! # "TrackMouseRegion", "RegisterToolboxObjectClass", "UnregisterToolboxObjectClass", Index: CarbonEvtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/CarbonEvtsupport.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CarbonEvtsupport.py 2002/01/03 20:45:47 1.9 --- CarbonEvtsupport.py 2002/01/08 11:49:31 1.10 *************** *** 69,72 **** --- 69,77 ---- + RgnHandle = OpaqueByValueType("RgnHandle", "ResObj") + GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj") + MouseTrackingResult = UInt16 + + includestuff = r""" #ifdef WITHOUT_FRAMEWORKS Index: _CarbonEvtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/_CarbonEvtmodule.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** _CarbonEvtmodule.c 2002/01/03 20:45:47 1.6 --- _CarbonEvtmodule.c 2002/01/08 11:49:31 1.7 *************** *** 1391,1394 **** --- 1391,1466 ---- } + static PyObject *CarbonEvents_TrackMouseLocation(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + OSStatus _err; + GrafPtr inPort; + Point outPt; + UInt16 outResult; + if (!PyArg_ParseTuple(_args, "O&", + GrafObj_Convert, &inPort)) + return NULL; + _err = TrackMouseLocation(inPort, + &outPt, + &outResult); + if (_err != noErr) return PyMac_Error(_err); + _res = Py_BuildValue("O&H", + PyMac_BuildPoint, outPt, + outResult); + return _res; + } + + static PyObject *CarbonEvents_TrackMouseLocationWithOptions(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + OSStatus _err; + GrafPtr inPort; + OptionBits inOptions; + double inTimeout; + Point outPt; + UInt32 outModifiers; + UInt16 outResult; + if (!PyArg_ParseTuple(_args, "O&ld", + GrafObj_Convert, &inPort, + &inOptions, + &inTimeout)) + return NULL; + _err = TrackMouseLocationWithOptions(inPort, + inOptions, + inTimeout, + &outPt, + &outModifiers, + &outResult); + if (_err != noErr) return PyMac_Error(_err); + _res = Py_BuildValue("O&lH", + PyMac_BuildPoint, outPt, + outModifiers, + outResult); + return _res; + } + + static PyObject *CarbonEvents_TrackMouseRegion(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + OSStatus _err; + GrafPtr inPort; + RgnHandle inRegion; + Boolean ioWasInRgn; + UInt16 outResult; + if (!PyArg_ParseTuple(_args, "O&O&", + GrafObj_Convert, &inPort, + ResObj_Convert, &inRegion)) + return NULL; + _err = TrackMouseRegion(inPort, + inRegion, + &ioWasInRgn, + &outResult); + if (_err != noErr) return PyMac_Error(_err); + _res = Py_BuildValue("bH", + ioWasInRgn, + outResult); + return _res; + } + static PyObject *CarbonEvents_GetLastUserEventTime(PyObject *_self, PyObject *_args) { *************** *** 1719,1722 **** --- 1791,1800 ---- {"GetCurrentEventTime", (PyCFunction)CarbonEvents_GetCurrentEventTime, 1, "() -> (double _rv)"}, + {"TrackMouseLocation", (PyCFunction)CarbonEvents_TrackMouseLocation, 1, + "(GrafPtr inPort) -> (Point outPt, UInt16 outResult)"}, + {"TrackMouseLocationWithOptions", (PyCFunction)CarbonEvents_TrackMouseLocationWithOptions, 1, + "(GrafPtr inPort, OptionBits inOptions, double inTimeout) -> (Point outPt, UInt32 outModifiers, UInt16 outResult)"}, + {"TrackMouseRegion", (PyCFunction)CarbonEvents_TrackMouseRegion, 1, + "(GrafPtr inPort, RgnHandle inRegion) -> (Boolean ioWasInRgn, UInt16 outResult)"}, {"GetLastUserEventTime", (PyCFunction)CarbonEvents_GetLastUserEventTime, 1, "() -> (double _rv)"},
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4