summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/evt
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-09 20:56:31 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-06-09 20:56:31 (GMT)
commit7d0bc8343f55f2e467abb2ce50b76b054897d72f (patch)
treec3a2618e7c6c09c201d03bb67dc1038cab7dc534 /Mac/Modules/evt
parenta0e76bebd3ddb05461c9f692ff1f53267203aaae (diff)
downloadcpython-7d0bc8343f55f2e467abb2ce50b76b054897d72f.zip
cpython-7d0bc8343f55f2e467abb2ce50b76b054897d72f.tar.gz
cpython-7d0bc8343f55f2e467abb2ce50b76b054897d72f.tar.bz2
Ported to Universal Header 2.0.1f (i.e. CW6)
Diffstat (limited to 'Mac/Modules/evt')
-rw-r--r--Mac/Modules/evt/Evtmodule.c78
-rw-r--r--Mac/Modules/evt/evtgen.py32
-rw-r--r--Mac/Modules/evt/evtscan.py3
-rw-r--r--Mac/Modules/evt/evtsupport.py2
4 files changed, 59 insertions, 56 deletions
diff --git a/Mac/Modules/evt/Evtmodule.c b/Mac/Modules/evt/Evtmodule.c
index 7169b59..7732d09 100644
--- a/Mac/Modules/evt/Evtmodule.c
+++ b/Mac/Modules/evt/Evtmodule.c
@@ -39,26 +39,12 @@ extern PyObject *WinObj_WhichWindow(WindowPtr);
static PyObject *Evt_Error;
-static PyObject *Evt_GetDblTime(_self, _args)
- PyObject *_self;
- PyObject *_args;
-{
- PyObject *_res = NULL;
- long _rv;
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetDblTime();
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-
static PyObject *Evt_GetCaretTime(_self, _args)
PyObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
- long _rv;
+ UInt32 _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetCaretTime();
@@ -72,7 +58,7 @@ static PyObject *Evt_SetEventMask(_self, _args)
PyObject *_args;
{
PyObject *_res = NULL;
- short value;
+ MacOSEventMask value;
if (!PyArg_ParseTuple(_args, "h",
&value))
return NULL;
@@ -82,13 +68,27 @@ static PyObject *Evt_SetEventMask(_self, _args)
return _res;
}
+static PyObject *Evt_GetDblTime(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ UInt32 _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = GetDblTime();
+ _res = Py_BuildValue("l",
+ _rv);
+ return _res;
+}
+
static PyObject *Evt_GetNextEvent(_self, _args)
PyObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
Boolean _rv;
- short eventMask;
+ MacOSEventMask eventMask;
EventRecord theEvent;
if (!PyArg_ParseTuple(_args, "h",
&eventMask))
@@ -107,9 +107,9 @@ static PyObject *Evt_WaitNextEvent(_self, _args)
{
PyObject *_res = NULL;
Boolean _rv;
- short eventMask;
+ MacOSEventMask eventMask;
EventRecord theEvent;
- unsigned long sleep;
+ UInt32 sleep;
if (!PyArg_ParseTuple(_args, "hl",
&eventMask,
&sleep))
@@ -130,7 +130,7 @@ static PyObject *Evt_EventAvail(_self, _args)
{
PyObject *_res = NULL;
Boolean _rv;
- short eventMask;
+ MacOSEventMask eventMask;
EventRecord theEvent;
if (!PyArg_ParseTuple(_args, "h",
&eventMask))
@@ -219,7 +219,7 @@ static PyObject *Evt_TickCount(_self, _args)
PyObject *_args;
{
PyObject *_res = NULL;
- unsigned long _rv;
+ UInt32 _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = TickCount();
@@ -234,8 +234,8 @@ static PyObject *Evt_PostEvent(_self, _args)
{
PyObject *_res = NULL;
OSErr _err;
- short eventNum;
- long eventMsg;
+ MacOSEventKind eventNum;
+ UInt32 eventMsg;
if (!PyArg_ParseTuple(_args, "hl",
&eventNum,
&eventMsg))
@@ -254,7 +254,7 @@ static PyObject *Evt_OSEventAvail(_self, _args)
{
PyObject *_res = NULL;
Boolean _rv;
- short mask;
+ MacOSEventMask mask;
EventRecord theEvent;
if (!PyArg_ParseTuple(_args, "h",
&mask))
@@ -273,7 +273,7 @@ static PyObject *Evt_GetOSEvent(_self, _args)
{
PyObject *_res = NULL;
Boolean _rv;
- short mask;
+ MacOSEventMask mask;
EventRecord theEvent;
if (!PyArg_ParseTuple(_args, "h",
&mask))
@@ -291,8 +291,8 @@ static PyObject *Evt_FlushEvents(_self, _args)
PyObject *_args;
{
PyObject *_res = NULL;
- short whichMask;
- short stopMask;
+ MacOSEventMask whichMask;
+ MacOSEventMask stopMask;
if (!PyArg_ParseTuple(_args, "hh",
&whichMask,
&stopMask))
@@ -352,18 +352,18 @@ static PyObject *Evt_SystemEvent(_self, _args)
}
static PyMethodDef Evt_methods[] = {
- {"GetDblTime", (PyCFunction)Evt_GetDblTime, 1,
- "() -> (long _rv)"},
{"GetCaretTime", (PyCFunction)Evt_GetCaretTime, 1,
- "() -> (long _rv)"},
+ "() -> (UInt32 _rv)"},
{"SetEventMask", (PyCFunction)Evt_SetEventMask, 1,
- "(short value) -> None"},
+ "(MacOSEventMask value) -> None"},
+ {"GetDblTime", (PyCFunction)Evt_GetDblTime, 1,
+ "() -> (UInt32 _rv)"},
{"GetNextEvent", (PyCFunction)Evt_GetNextEvent, 1,
- "(short eventMask) -> (Boolean _rv, EventRecord theEvent)"},
+ "(MacOSEventMask eventMask) -> (Boolean _rv, EventRecord theEvent)"},
{"WaitNextEvent", (PyCFunction)Evt_WaitNextEvent, 1,
- "(short eventMask, unsigned long sleep) -> (Boolean _rv, EventRecord theEvent)"},
+ "(MacOSEventMask eventMask, UInt32 sleep) -> (Boolean _rv, EventRecord theEvent)"},
{"EventAvail", (PyCFunction)Evt_EventAvail, 1,
- "(short eventMask) -> (Boolean _rv, EventRecord theEvent)"},
+ "(MacOSEventMask eventMask) -> (Boolean _rv, EventRecord theEvent)"},
{"GetMouse", (PyCFunction)Evt_GetMouse, 1,
"() -> (Point mouseLoc)"},
{"Button", (PyCFunction)Evt_Button, 1,
@@ -375,15 +375,15 @@ static PyMethodDef Evt_methods[] = {
{"GetKeys", (PyCFunction)Evt_GetKeys, 1,
"() -> (KeyMap theKeys)"},
{"TickCount", (PyCFunction)Evt_TickCount, 1,
- "() -> (unsigned long _rv)"},
+ "() -> (UInt32 _rv)"},
{"PostEvent", (PyCFunction)Evt_PostEvent, 1,
- "(short eventNum, long eventMsg) -> None"},
+ "(MacOSEventKind eventNum, UInt32 eventMsg) -> None"},
{"OSEventAvail", (PyCFunction)Evt_OSEventAvail, 1,
- "(short mask) -> (Boolean _rv, EventRecord theEvent)"},
+ "(MacOSEventMask mask) -> (Boolean _rv, EventRecord theEvent)"},
{"GetOSEvent", (PyCFunction)Evt_GetOSEvent, 1,
- "(short mask) -> (Boolean _rv, EventRecord theEvent)"},
+ "(MacOSEventMask mask) -> (Boolean _rv, EventRecord theEvent)"},
{"FlushEvents", (PyCFunction)Evt_FlushEvents, 1,
- "(short whichMask, short stopMask) -> None"},
+ "(MacOSEventMask whichMask, MacOSEventMask stopMask) -> None"},
{"SystemClick", (PyCFunction)Evt_SystemClick, 1,
"(EventRecord theEvent, WindowPtr theWindow) -> None"},
{"SystemTask", (PyCFunction)Evt_SystemTask, 1,
diff --git a/Mac/Modules/evt/evtgen.py b/Mac/Modules/evt/evtgen.py
index deac64e..1ca2962 100644
--- a/Mac/Modules/evt/evtgen.py
+++ b/Mac/Modules/evt/evtgen.py
@@ -1,34 +1,34 @@
-# Generated from 'Moes:CW5 GOLD \304:Metrowerks C/C++ \304:Headers \304:Universal Headers 2.0a3 \304:Events.h'
+# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Events.h'
-f = Function(long, 'GetDblTime',
+f = Function(UInt32, 'GetCaretTime',
)
functions.append(f)
-f = Function(long, 'GetCaretTime',
+f = Function(void, 'SetEventMask',
+ (MacOSEventMask, 'value', InMode),
)
functions.append(f)
-f = Function(void, 'SetEventMask',
- (short, 'value', InMode),
+f = Function(UInt32, 'GetDblTime',
)
functions.append(f)
f = Function(Boolean, 'GetNextEvent',
- (short, 'eventMask', InMode),
+ (MacOSEventMask, 'eventMask', InMode),
(EventRecord, 'theEvent', OutMode),
)
functions.append(f)
f = Function(Boolean, 'WaitNextEvent',
- (short, 'eventMask', InMode),
+ (MacOSEventMask, 'eventMask', InMode),
(EventRecord, 'theEvent', OutMode),
- (unsigned_long, 'sleep', InMode),
+ (UInt32, 'sleep', InMode),
(RgnHandle, 'mouseRgn', InMode),
)
functions.append(f)
f = Function(Boolean, 'EventAvail',
- (short, 'eventMask', InMode),
+ (MacOSEventMask, 'eventMask', InMode),
(EventRecord, 'theEvent', OutMode),
)
functions.append(f)
@@ -55,31 +55,31 @@ f = Function(void, 'GetKeys',
)
functions.append(f)
-f = Function(unsigned_long, 'TickCount',
+f = Function(UInt32, 'TickCount',
)
functions.append(f)
f = Function(OSErr, 'PostEvent',
- (short, 'eventNum', InMode),
- (long, 'eventMsg', InMode),
+ (MacOSEventKind, 'eventNum', InMode),
+ (UInt32, 'eventMsg', InMode),
)
functions.append(f)
f = Function(Boolean, 'OSEventAvail',
- (short, 'mask', InMode),
+ (MacOSEventMask, 'mask', InMode),
(EventRecord, 'theEvent', OutMode),
)
functions.append(f)
f = Function(Boolean, 'GetOSEvent',
- (short, 'mask', InMode),
+ (MacOSEventMask, 'mask', InMode),
(EventRecord, 'theEvent', OutMode),
)
functions.append(f)
f = Function(void, 'FlushEvents',
- (short, 'whichMask', InMode),
- (short, 'stopMask', InMode),
+ (MacOSEventMask, 'whichMask', InMode),
+ (MacOSEventMask, 'stopMask', InMode),
)
functions.append(f)
diff --git a/Mac/Modules/evt/evtscan.py b/Mac/Modules/evt/evtscan.py
index 70a9df9..dc3b6ce 100644
--- a/Mac/Modules/evt/evtscan.py
+++ b/Mac/Modules/evt/evtscan.py
@@ -34,7 +34,8 @@ class MyScanner(Scanner):
def makeblacklistnames(self):
return [
- "KeyTranslate"
+ "KeyTranslate",
+ "GetEventMask", # I cannot seem to find this routine...
]
def makeblacklisttypes(self):
diff --git a/Mac/Modules/evt/evtsupport.py b/Mac/Modules/evt/evtsupport.py
index 0a6950b..39ddaa9 100644
--- a/Mac/Modules/evt/evtsupport.py
+++ b/Mac/Modules/evt/evtsupport.py
@@ -27,6 +27,8 @@ from macsupport import *
RgnHandle = FakeType("(RgnHandle)0") # XXX
KeyMap = ArrayOutputBufferType("KeyMap")
+MacOSEventKind = Type("MacOSEventKind", "h")
+MacOSEventMask = Type("MacOSEventMask", "h")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """