[Python-checkins] python/dist/src/Mac/Modules/evt _Evtmodule.c,1.7,1.8 evtscan.py,1.12,1.13
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
Thu, 12 Dec 2002 02:32:23 -0800
Update of /cvsroot/python/python/dist/src/Mac/Modules/evt
In directory sc8-pr-cvs1:/tmp/cvs-serv21368/Modules/evt
Modified Files:
_Evtmodule.c evtscan.py
Log Message:
Getting rid of pre-Carbon (MacOS8) support. All code depending on
TARGET_API_MAC_OS8 (or !TARGET_API_MAC_CARBON) is gone. Also some
TARGET_API_MAC_OSX conditional code is gone, because it is no longer
used on OSX-only Python (only in MacPython-OS9).
Index: _Evtmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/evt/_Evtmodule.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** _Evtmodule.c 16 Aug 2002 09:09:26 -0000 1.7
--- _Evtmodule.c 12 Dec 2002 10:31:50 -0000 1.8
***************
*** 212,261 ****
}
- #if !TARGET_API_MAC_CARBON
-
- static PyObject *Evt_OSEventAvail(PyObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Boolean _rv;
- EventMask mask;
- EventRecord theEvent;
- #ifndef OSEventAvail
- PyMac_PRECHECK(OSEventAvail);
- #endif
- if (!PyArg_ParseTuple(_args, "H",
- &mask))
- return NULL;
- _rv = OSEventAvail(mask,
- &theEvent);
- _res = Py_BuildValue("bO&",
- _rv,
- PyMac_BuildEventRecord, &theEvent);
- return _res;
- }
- #endif
-
- #if !TARGET_API_MAC_CARBON
-
- static PyObject *Evt_GetOSEvent(PyObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Boolean _rv;
- EventMask mask;
- EventRecord theEvent;
- #ifndef GetOSEvent
- PyMac_PRECHECK(GetOSEvent);
- #endif
- if (!PyArg_ParseTuple(_args, "H",
- &mask))
- return NULL;
- _rv = GetOSEvent(mask,
- &theEvent);
- _res = Py_BuildValue("bO&",
- _rv,
- PyMac_BuildEventRecord, &theEvent);
- return _res;
- }
- #endif
-
static PyObject *Evt_FlushEvents(PyObject *_self, PyObject *_args)
{
--- 212,215 ----
***************
*** 277,341 ****
}
- #if !TARGET_API_MAC_CARBON
-
- static PyObject *Evt_SystemClick(PyObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- EventRecord theEvent;
- WindowPtr theWindow;
- #ifndef SystemClick
- PyMac_PRECHECK(SystemClick);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&",
- PyMac_GetEventRecord, &theEvent,
- WinObj_Convert, &theWindow))
- return NULL;
- SystemClick(&theEvent,
- theWindow);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- #endif
-
- #if !TARGET_API_MAC_CARBON
-
- static PyObject *Evt_SystemTask(PyObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- #ifndef SystemTask
- PyMac_PRECHECK(SystemTask);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- SystemTask();
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- #endif
-
- #if !TARGET_API_MAC_CARBON
-
- static PyObject *Evt_SystemEvent(PyObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Boolean _rv;
- EventRecord theEvent;
- #ifndef SystemEvent
- PyMac_PRECHECK(SystemEvent);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetEventRecord, &theEvent))
- return NULL;
- _rv = SystemEvent(&theEvent);
- _res = Py_BuildValue("b",
- _rv);
- return _res;
- }
- #endif
-
- #if TARGET_API_MAC_CARBON
-
static PyObject *Evt_GetGlobalMouse(PyObject *_self, PyObject *_args)
{
--- 231,234 ----
***************
*** 352,358 ****
return _res;
}
- #endif
-
- #if TARGET_API_MAC_CARBON
static PyObject *Evt_GetCurrentKeyModifiers(PyObject *_self, PyObject *_args)
--- 245,248 ----
***************
*** 370,376 ****
return _res;
}
- #endif
-
- #if TARGET_API_MAC_CARBON
static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_args)
--- 260,263 ----
***************
*** 388,392 ****
return _res;
}
- #endif
static PyObject *Evt_KeyScript(PyObject *_self, PyObject *_args)
--- 275,278 ----
***************
*** 614,659 ****
{"PostEvent", (PyCFunction)Evt_PostEvent, 1,
PyDoc_STR("(EventKind eventNum, UInt32 eventMsg) -> None")},
-
- #if !TARGET_API_MAC_CARBON
- {"OSEventAvail", (PyCFunction)Evt_OSEventAvail, 1,
- PyDoc_STR("(EventMask mask) -> (Boolean _rv, EventRecord theEvent)")},
- #endif
-
- #if !TARGET_API_MAC_CARBON
- {"GetOSEvent", (PyCFunction)Evt_GetOSEvent, 1,
- PyDoc_STR("(EventMask mask) -> (Boolean _rv, EventRecord theEvent)")},
- #endif
{"FlushEvents", (PyCFunction)Evt_FlushEvents, 1,
PyDoc_STR("(EventMask whichMask, EventMask stopMask) -> None")},
-
- #if !TARGET_API_MAC_CARBON
- {"SystemClick", (PyCFunction)Evt_SystemClick, 1,
- PyDoc_STR("(EventRecord theEvent, WindowPtr theWindow) -> None")},
- #endif
-
- #if !TARGET_API_MAC_CARBON
- {"SystemTask", (PyCFunction)Evt_SystemTask, 1,
- PyDoc_STR("() -> None")},
- #endif
-
- #if !TARGET_API_MAC_CARBON
- {"SystemEvent", (PyCFunction)Evt_SystemEvent, 1,
- PyDoc_STR("(EventRecord theEvent) -> (Boolean _rv)")},
- #endif
-
- #if TARGET_API_MAC_CARBON
{"GetGlobalMouse", (PyCFunction)Evt_GetGlobalMouse, 1,
PyDoc_STR("() -> (Point globalMouse)")},
- #endif
-
- #if TARGET_API_MAC_CARBON
{"GetCurrentKeyModifiers", (PyCFunction)Evt_GetCurrentKeyModifiers, 1,
PyDoc_STR("() -> (UInt32 _rv)")},
- #endif
-
- #if TARGET_API_MAC_CARBON
{"CheckEventQueueForUserCancel", (PyCFunction)Evt_CheckEventQueueForUserCancel, 1,
PyDoc_STR("() -> (Boolean _rv)")},
- #endif
{"KeyScript", (PyCFunction)Evt_KeyScript, 1,
PyDoc_STR("(short code) -> None")},
--- 500,511 ----
Index: evtscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/evt/evtscan.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** evtscan.py 15 Aug 2002 21:48:14 -0000 1.12
--- evtscan.py 12 Dec 2002 10:31:50 -0000 1.13
***************
*** 37,55 ****
return classname, listname
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'SystemEvent',
- 'SystemTask',
- 'SystemClick',
- 'GetOSEvent',
- 'OSEventAvail',
- ]),
- ('#if TARGET_API_MAC_CARBON', [
- 'CheckEventQueueForUserCancel',
- 'GetCurrentKeyModifiers',
- 'GetGlobalMouse',
- ])]
-
def makeblacklistnames(self):
return [
--- 37,40 ----
***************
*** 59,62 ****
--- 44,53 ----
# Constants with funny definitions
"osEvtMessageMask",
+ # OS8 calls
+ 'SystemEvent',
+ 'SystemTask',
+ 'SystemClick',
+ 'GetOSEvent',
+ 'OSEventAvail',
]