Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec982e2

Browse files
committed
TickCount moved to a different header file. We manually added it back in here, for conveninece.
1 parent 564980b commit ec982e2

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Mac/Modules/evt/_Evtmodule.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55

66

77

8+
#ifdef _WIN32
9+
#include "pywintoolbox.h"
10+
#else
811
#include "macglue.h"
912
#include "pymactoolbox.h"
13+
#endif
1014

1115
/* Macro to test whether a weak-loaded CFM function exists */
1216
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
@@ -455,6 +459,18 @@ static PyObject *Evt_LMSetKbdType(PyObject *_self, PyObject *_args)
455459
return _res;
456460
}
457461

462+
static PyObject *Evt_TickCount(PyObject *_self, PyObject *_args)
463+
{
464+
PyObject *_res = NULL;
465+
UInt32 _rv;
466+
if (!PyArg_ParseTuple(_args, ""))
467+
return NULL;
468+
_rv = TickCount();
469+
_res = Py_BuildValue("l",
470+
_rv);
471+
return _res;
472+
}
473+
458474
static PyObject *Evt_WaitNextEvent(PyObject *_self, PyObject *_args)
459475
{
460476
PyObject *_res = NULL;
@@ -566,6 +582,8 @@ static PyMethodDef Evt_methods[] = {
566582
"() -> (UInt8 _rv)"},
567583
{"LMSetKbdType", (PyCFunction)Evt_LMSetKbdType, 1,
568584
"(UInt8 value) -> None"},
585+
{"TickCount", (PyCFunction)Evt_TickCount, 1,
586+
"() -> (UInt32 _rv)"},
569587
{"WaitNextEvent", (PyCFunction)Evt_WaitNextEvent, 1,
570588
"(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"},
571589
{NULL, NULL, 0}

Mac/Modules/evt/evtsupport.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ def outputCheckConvertArg(self):
7272
##methods = []
7373
execfile(INPUTFILE)
7474

75+
# Move TickCount here, for convenience
76+
f = Function(UInt32, 'TickCount',
77+
)
78+
functions.append(f)
79+
7580
# add the populated lists to the generator groups
7681
# (in a different wordl the scan program would generate this)
7782
for f in functions: module.add(f)
@@ -102,6 +107,7 @@ def outputCheckConvertArg(self):
102107
f.docstring = lambda: "(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"
103108
module.add(f)
104109

110+
105111
# generate output (open the output file as late as possible)
106112
SetOutputFileName(OUTPUTFILE)
107113
module.generate()

0 commit comments

Comments
 (0)