]> granicus.if.org Git - python/commitdiff
TickCount moved to a different header file. We manually added it back in here, for...
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 17 Dec 2001 11:46:50 +0000 (11:46 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 17 Dec 2001 11:46:50 +0000 (11:46 +0000)
Mac/Modules/evt/_Evtmodule.c
Mac/Modules/evt/evtsupport.py

index 4afc049107790e0c204015106d700de7d49ffa09..7a977da624a3687ba3ad16194d70fe623200e155 100644 (file)
@@ -5,8 +5,12 @@
 
 
 
+#ifdef _WIN32
+#include "pywintoolbox.h"
+#else
 #include "macglue.h"
 #include "pymactoolbox.h"
+#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
@@ -455,6 +459,18 @@ static PyObject *Evt_LMSetKbdType(PyObject *_self, PyObject *_args)
        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)
 {
        PyObject *_res = NULL;
@@ -566,6 +582,8 @@ static PyMethodDef Evt_methods[] = {
         "() -> (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)"},
        {NULL, NULL, 0}
index ede353d2124ab60c7257c02c4bc357274529c145..d09403a0856ee6212982feda99e369d71fa9f14d 100644 (file)
@@ -72,6 +72,11 @@ functions = []
 ##methods = []
 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)
 for f in functions: module.add(f)
@@ -102,6 +107,7 @@ f = ManualGenerator("WaitNextEvent", WaitNextEvent_body);
 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)
 SetOutputFileName(OUTPUTFILE)
 module.generate()