summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/evt
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-12-10 23:43:49 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-12-10 23:43:49 (GMT)
commitf7d5aa61d34cb7816ead2757860e5a66f7da0dcb (patch)
treefaba3f23c2f0fdfa74a156d441f6fa8945c337f8 /Mac/Modules/evt
parentc6c283840316dec54244b311657511e95e742eb0 (diff)
downloadcpython-f7d5aa61d34cb7816ead2757860e5a66f7da0dcb.zip
cpython-f7d5aa61d34cb7816ead2757860e5a66f7da0dcb.tar.gz
cpython-f7d5aa61d34cb7816ead2757860e5a66f7da0dcb.tar.bz2
Adapted to Universal Headers 3.3.2. More to follow.
Diffstat (limited to 'Mac/Modules/evt')
-rw-r--r--Mac/Modules/evt/Evtmodule.c68
-rw-r--r--Mac/Modules/evt/evtscan.py5
2 files changed, 72 insertions, 1 deletions
diff --git a/Mac/Modules/evt/Evtmodule.c b/Mac/Modules/evt/Evtmodule.c
index c161c75..ed18f9c 100644
--- a/Mac/Modules/evt/Evtmodule.c
+++ b/Mac/Modules/evt/Evtmodule.c
@@ -316,6 +316,57 @@ static PyObject *Evt_SystemEvent(_self, _args)
}
#endif
+#if TARGET_API_MAC_CARBON
+
+static PyObject *Evt_GetGlobalMouse(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Point globalMouse;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ GetGlobalMouse(&globalMouse);
+ _res = Py_BuildValue("O&",
+ PyMac_BuildPoint, globalMouse);
+ return _res;
+}
+#endif
+
+#if TARGET_API_MAC_CARBON
+
+static PyObject *Evt_GetCurrentKeyModifiers(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ UInt32 _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = GetCurrentKeyModifiers();
+ _res = Py_BuildValue("l",
+ _rv);
+ return _res;
+}
+#endif
+
+#if TARGET_API_MAC_CARBON
+
+static PyObject *Evt_CheckEventQueueForUserCancel(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Boolean _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = CheckEventQueueForUserCancel();
+ _res = Py_BuildValue("b",
+ _rv);
+ return _res;
+}
+#endif
+
static PyObject *Evt_WaitNextEvent(_self, _args)
PyObject *_self;
PyObject *_args;
@@ -396,6 +447,21 @@ static PyMethodDef Evt_methods[] = {
{"SystemEvent", (PyCFunction)Evt_SystemEvent, 1,
"(EventRecord theEvent) -> (Boolean _rv)"},
#endif
+
+#if TARGET_API_MAC_CARBON
+ {"GetGlobalMouse", (PyCFunction)Evt_GetGlobalMouse, 1,
+ "() -> (Point globalMouse)"},
+#endif
+
+#if TARGET_API_MAC_CARBON
+ {"GetCurrentKeyModifiers", (PyCFunction)Evt_GetCurrentKeyModifiers, 1,
+ "() -> (UInt32 _rv)"},
+#endif
+
+#if TARGET_API_MAC_CARBON
+ {"CheckEventQueueForUserCancel", (PyCFunction)Evt_CheckEventQueueForUserCancel, 1,
+ "() -> (Boolean _rv)"},
+#endif
{"WaitNextEvent", (PyCFunction)Evt_WaitNextEvent, 1,
"(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"},
{NULL, NULL, 0}
@@ -417,7 +483,7 @@ void initEvt()
Evt_Error = PyMac_GetOSErrException();
if (Evt_Error == NULL ||
PyDict_SetItemString(d, "Error", Evt_Error) != 0)
- Py_FatalError("can't initialize Evt.Error");
+ return;
}
/* ========================= End module Evt ========================= */
diff --git a/Mac/Modules/evt/evtscan.py b/Mac/Modules/evt/evtscan.py
index 3695440..82b9260 100644
--- a/Mac/Modules/evt/evtscan.py
+++ b/Mac/Modules/evt/evtscan.py
@@ -43,6 +43,11 @@ class MyScanner(Scanner):
'SystemClick',
'GetOSEvent',
'OSEventAvail',
+ ]),
+ ('#if TARGET_API_MAC_CARBON', [
+ 'CheckEventQueueForUserCancel',
+ 'GetCurrentKeyModifiers',
+ 'GetGlobalMouse',
])]
def makeblacklistnames(self):