@@ -1390,6 +1390,78 @@ static PyObject *CarbonEvents_GetCurrentEventTime(PyObject *_self, PyObject *_ar
13901390 return _res ;
13911391}
13921392
1393+ static PyObject * CarbonEvents_TrackMouseLocation (PyObject * _self , PyObject * _args )
1394+ {
1395+ PyObject * _res = NULL ;
1396+ OSStatus _err ;
1397+ GrafPtr inPort ;
1398+ Point outPt ;
1399+ UInt16 outResult ;
1400+ if (!PyArg_ParseTuple (_args , "O&" ,
1401+ GrafObj_Convert , & inPort ))
1402+ return NULL ;
1403+ _err = TrackMouseLocation (inPort ,
1404+ & outPt ,
1405+ & outResult );
1406+ if (_err != noErr ) return PyMac_Error (_err );
1407+ _res = Py_BuildValue ("O&H" ,
1408+ PyMac_BuildPoint , outPt ,
1409+ outResult );
1410+ return _res ;
1411+ }
1412+
1413+ static PyObject * CarbonEvents_TrackMouseLocationWithOptions (PyObject * _self , PyObject * _args )
1414+ {
1415+ PyObject * _res = NULL ;
1416+ OSStatus _err ;
1417+ GrafPtr inPort ;
1418+ OptionBits inOptions ;
1419+ double inTimeout ;
1420+ Point outPt ;
1421+ UInt32 outModifiers ;
1422+ UInt16 outResult ;
1423+ if (!PyArg_ParseTuple (_args , "O&ld" ,
1424+ GrafObj_Convert , & inPort ,
1425+ & inOptions ,
1426+ & inTimeout ))
1427+ return NULL ;
1428+ _err = TrackMouseLocationWithOptions (inPort ,
1429+ inOptions ,
1430+ inTimeout ,
1431+ & outPt ,
1432+ & outModifiers ,
1433+ & outResult );
1434+ if (_err != noErr ) return PyMac_Error (_err );
1435+ _res = Py_BuildValue ("O&lH" ,
1436+ PyMac_BuildPoint , outPt ,
1437+ outModifiers ,
1438+ outResult );
1439+ return _res ;
1440+ }
1441+
1442+ static PyObject * CarbonEvents_TrackMouseRegion (PyObject * _self , PyObject * _args )
1443+ {
1444+ PyObject * _res = NULL ;
1445+ OSStatus _err ;
1446+ GrafPtr inPort ;
1447+ RgnHandle inRegion ;
1448+ Boolean ioWasInRgn ;
1449+ UInt16 outResult ;
1450+ if (!PyArg_ParseTuple (_args , "O&O&" ,
1451+ GrafObj_Convert , & inPort ,
1452+ ResObj_Convert , & inRegion ))
1453+ return NULL ;
1454+ _err = TrackMouseRegion (inPort ,
1455+ inRegion ,
1456+ & ioWasInRgn ,
1457+ & outResult );
1458+ if (_err != noErr ) return PyMac_Error (_err );
1459+ _res = Py_BuildValue ("bH" ,
1460+ ioWasInRgn ,
1461+ outResult );
1462+ return _res ;
1463+ }
1464+
13931465static PyObject * CarbonEvents_GetLastUserEventTime (PyObject * _self , PyObject * _args )
13941466{
13951467 PyObject * _res = NULL ;
@@ -1718,6 +1790,12 @@ static PyMethodDef CarbonEvents_methods[] = {
17181790 "() -> (EventQueueRef _rv)" },
17191791 {"GetCurrentEventTime" , (PyCFunction )CarbonEvents_GetCurrentEventTime , 1 ,
17201792 "() -> (double _rv)" },
1793+ {"TrackMouseLocation" , (PyCFunction )CarbonEvents_TrackMouseLocation , 1 ,
1794+ "(GrafPtr inPort) -> (Point outPt, UInt16 outResult)" },
1795+ {"TrackMouseLocationWithOptions" , (PyCFunction )CarbonEvents_TrackMouseLocationWithOptions , 1 ,
1796+ "(GrafPtr inPort, OptionBits inOptions, double inTimeout) -> (Point outPt, UInt32 outModifiers, UInt16 outResult)" },
1797+ {"TrackMouseRegion" , (PyCFunction )CarbonEvents_TrackMouseRegion , 1 ,
1798+ "(GrafPtr inPort, RgnHandle inRegion) -> (Boolean ioWasInRgn, UInt16 outResult)" },
17211799 {"GetLastUserEventTime" , (PyCFunction )CarbonEvents_GetLastUserEventTime , 1 ,
17221800 "() -> (double _rv)" },
17231801 {"GetWindowEventTarget" , (PyCFunction )CarbonEvents_GetWindowEventTarget , 1 ,
0 commit comments