summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/carbonevt/_CarbonEvtmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Modules/carbonevt/_CarbonEvtmodule.c')
-rwxr-xr-xMac/Modules/carbonevt/_CarbonEvtmodule.c56
1 files changed, 24 insertions, 32 deletions
diff --git a/Mac/Modules/carbonevt/_CarbonEvtmodule.c b/Mac/Modules/carbonevt/_CarbonEvtmodule.c
index fd4b266..7b44228 100755
--- a/Mac/Modules/carbonevt/_CarbonEvtmodule.c
+++ b/Mac/Modules/carbonevt/_CarbonEvtmodule.c
@@ -151,7 +151,7 @@ int EventRef_Convert(PyObject *v, EventRef *p_itself)
static void EventRef_dealloc(EventRefObject *self)
{
/* Cleanup of self->ob_itself goes here */
- self->ob_type->tp_free((PyObject *)self);
+ Py_Type(self)->tp_free((PyObject *)self);
}
static PyObject *EventRef_RetainEvent(EventRefObject *_self, PyObject *_args)
@@ -416,8 +416,7 @@ static PyObject *EventRef_tp_new(PyTypeObject *type, PyObject *_args, PyObject *
PyTypeObject EventRef_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
+ PyVarObject_HEAD_INIT(NULL, 0)
"_CarbonEvt.EventRef", /*tp_name*/
sizeof(EventRefObject), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -496,7 +495,7 @@ int EventQueueRef_Convert(PyObject *v, EventQueueRef *p_itself)
static void EventQueueRef_dealloc(EventQueueRefObject *self)
{
/* Cleanup of self->ob_itself goes here */
- self->ob_type->tp_free((PyObject *)self);
+ Py_Type(self)->tp_free((PyObject *)self);
}
static PyObject *EventQueueRef_PostEventToQueue(EventQueueRefObject *_self, PyObject *_args)
@@ -637,8 +636,7 @@ static PyObject *EventQueueRef_tp_new(PyTypeObject *type, PyObject *_args, PyObj
PyTypeObject EventQueueRef_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
+ PyVarObject_HEAD_INIT(NULL, 0)
"_CarbonEvt.EventQueueRef", /*tp_name*/
sizeof(EventQueueRefObject), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -717,7 +715,7 @@ int EventLoopRef_Convert(PyObject *v, EventLoopRef *p_itself)
static void EventLoopRef_dealloc(EventLoopRefObject *self)
{
/* Cleanup of self->ob_itself goes here */
- self->ob_type->tp_free((PyObject *)self);
+ Py_Type(self)->tp_free((PyObject *)self);
}
static PyObject *EventLoopRef_QuitEventLoop(EventLoopRefObject *_self, PyObject *_args)
@@ -767,8 +765,7 @@ static PyObject *EventLoopRef_tp_new(PyTypeObject *type, PyObject *_args, PyObje
PyTypeObject EventLoopRef_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
+ PyVarObject_HEAD_INIT(NULL, 0)
"_CarbonEvt.EventLoopRef", /*tp_name*/
sizeof(EventLoopRefObject), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -847,7 +844,7 @@ int EventLoopTimerRef_Convert(PyObject *v, EventLoopTimerRef *p_itself)
static void EventLoopTimerRef_dealloc(EventLoopTimerRefObject *self)
{
/* Cleanup of self->ob_itself goes here */
- self->ob_type->tp_free((PyObject *)self);
+ Py_Type(self)->tp_free((PyObject *)self);
}
static PyObject *EventLoopTimerRef_RemoveEventLoopTimer(EventLoopTimerRefObject *_self, PyObject *_args)
@@ -915,8 +912,7 @@ static PyObject *EventLoopTimerRef_tp_new(PyTypeObject *type, PyObject *_args, P
PyTypeObject EventLoopTimerRef_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
+ PyVarObject_HEAD_INIT(NULL, 0)
"_CarbonEvt.EventLoopTimerRef", /*tp_name*/
sizeof(EventLoopTimerRefObject), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -1000,7 +996,7 @@ static void EventHandlerRef_dealloc(EventHandlerRefObject *self)
RemoveEventHandler(self->ob_itself);
Py_DECREF(self->ob_callback);
}
- self->ob_type->tp_free((PyObject *)self);
+ Py_Type(self)->tp_free((PyObject *)self);
}
static PyObject *EventHandlerRef_AddEventTypesToHandler(EventHandlerRefObject *_self, PyObject *_args)
@@ -1108,8 +1104,7 @@ static PyObject *EventHandlerRef_tp_new(PyTypeObject *type, PyObject *_args, PyO
PyTypeObject EventHandlerRef_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
+ PyVarObject_HEAD_INIT(NULL, 0)
"_CarbonEvt.EventHandlerRef", /*tp_name*/
sizeof(EventHandlerRefObject), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -1188,7 +1183,7 @@ int EventHandlerCallRef_Convert(PyObject *v, EventHandlerCallRef *p_itself)
static void EventHandlerCallRef_dealloc(EventHandlerCallRefObject *self)
{
/* Cleanup of self->ob_itself goes here */
- self->ob_type->tp_free((PyObject *)self);
+ Py_Type(self)->tp_free((PyObject *)self);
}
static PyObject *EventHandlerCallRef_CallNextEventHandler(EventHandlerCallRefObject *_self, PyObject *_args)
@@ -1241,8 +1236,7 @@ static PyObject *EventHandlerCallRef_tp_new(PyTypeObject *type, PyObject *_args,
PyTypeObject EventHandlerCallRef_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
+ PyVarObject_HEAD_INIT(NULL, 0)
"_CarbonEvt.EventHandlerCallRef", /*tp_name*/
sizeof(EventHandlerCallRefObject), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -1321,7 +1315,7 @@ int EventTargetRef_Convert(PyObject *v, EventTargetRef *p_itself)
static void EventTargetRef_dealloc(EventTargetRefObject *self)
{
/* Cleanup of self->ob_itself goes here */
- self->ob_type->tp_free((PyObject *)self);
+ Py_Type(self)->tp_free((PyObject *)self);
}
static PyObject *EventTargetRef_InstallStandardEventHandler(EventTargetRefObject *_self, PyObject *_args)
@@ -1396,8 +1390,7 @@ static PyObject *EventTargetRef_tp_new(PyTypeObject *type, PyObject *_args, PyOb
PyTypeObject EventTargetRef_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
+ PyVarObject_HEAD_INIT(NULL, 0)
"_CarbonEvt.EventTargetRef", /*tp_name*/
sizeof(EventTargetRefObject), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -1476,7 +1469,7 @@ int EventHotKeyRef_Convert(PyObject *v, EventHotKeyRef *p_itself)
static void EventHotKeyRef_dealloc(EventHotKeyRefObject *self)
{
/* Cleanup of self->ob_itself goes here */
- self->ob_type->tp_free((PyObject *)self);
+ Py_Type(self)->tp_free((PyObject *)self);
}
static PyObject *EventHotKeyRef_UnregisterEventHotKey(EventHotKeyRefObject *_self, PyObject *_args)
@@ -1526,8 +1519,7 @@ static PyObject *EventHotKeyRef_tp_new(PyTypeObject *type, PyObject *_args, PyOb
PyTypeObject EventHotKeyRef_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
+ PyVarObject_HEAD_INIT(NULL, 0)
"_CarbonEvt.EventHotKeyRef", /*tp_name*/
sizeof(EventHotKeyRefObject), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -2160,56 +2152,56 @@ void init_CarbonEvt(void)
if (CarbonEvents_Error == NULL ||
PyDict_SetItemString(d, "Error", CarbonEvents_Error) != 0)
return;
- EventRef_Type.ob_type = &PyType_Type;
+ Py_Type(&EventRef_Type) = &PyType_Type;
if (PyType_Ready(&EventRef_Type) < 0) return;
Py_INCREF(&EventRef_Type);
PyModule_AddObject(m, "EventRef", (PyObject *)&EventRef_Type);
/* Backward-compatible name */
Py_INCREF(&EventRef_Type);
PyModule_AddObject(m, "EventRefType", (PyObject *)&EventRef_Type);
- EventQueueRef_Type.ob_type = &PyType_Type;
+ Py_Type(&EventQueueRef_Type) = &PyType_Type;
if (PyType_Ready(&EventQueueRef_Type) < 0) return;
Py_INCREF(&EventQueueRef_Type);
PyModule_AddObject(m, "EventQueueRef", (PyObject *)&EventQueueRef_Type);
/* Backward-compatible name */
Py_INCREF(&EventQueueRef_Type);
PyModule_AddObject(m, "EventQueueRefType", (PyObject *)&EventQueueRef_Type);
- EventLoopRef_Type.ob_type = &PyType_Type;
+ Py_Type(&EventLoopRef_Type) = &PyType_Type;
if (PyType_Ready(&EventLoopRef_Type) < 0) return;
Py_INCREF(&EventLoopRef_Type);
PyModule_AddObject(m, "EventLoopRef", (PyObject *)&EventLoopRef_Type);
/* Backward-compatible name */
Py_INCREF(&EventLoopRef_Type);
PyModule_AddObject(m, "EventLoopRefType", (PyObject *)&EventLoopRef_Type);
- EventLoopTimerRef_Type.ob_type = &PyType_Type;
+ Py_Type(&EventLoopTimerRef_Type) = &PyType_Type;
if (PyType_Ready(&EventLoopTimerRef_Type) < 0) return;
Py_INCREF(&EventLoopTimerRef_Type);
PyModule_AddObject(m, "EventLoopTimerRef", (PyObject *)&EventLoopTimerRef_Type);
/* Backward-compatible name */
Py_INCREF(&EventLoopTimerRef_Type);
PyModule_AddObject(m, "EventLoopTimerRefType", (PyObject *)&EventLoopTimerRef_Type);
- EventHandlerRef_Type.ob_type = &PyType_Type;
+ Py_Type(&EventHandlerRef_Type) = &PyType_Type;
if (PyType_Ready(&EventHandlerRef_Type) < 0) return;
Py_INCREF(&EventHandlerRef_Type);
PyModule_AddObject(m, "EventHandlerRef", (PyObject *)&EventHandlerRef_Type);
/* Backward-compatible name */
Py_INCREF(&EventHandlerRef_Type);
PyModule_AddObject(m, "EventHandlerRefType", (PyObject *)&EventHandlerRef_Type);
- EventHandlerCallRef_Type.ob_type = &PyType_Type;
+ Py_Type(&EventHandlerCallRef_Type) = &PyType_Type;
if (PyType_Ready(&EventHandlerCallRef_Type) < 0) return;
Py_INCREF(&EventHandlerCallRef_Type);
PyModule_AddObject(m, "EventHandlerCallRef", (PyObject *)&EventHandlerCallRef_Type);
/* Backward-compatible name */
Py_INCREF(&EventHandlerCallRef_Type);
PyModule_AddObject(m, "EventHandlerCallRefType", (PyObject *)&EventHandlerCallRef_Type);
- EventTargetRef_Type.ob_type = &PyType_Type;
+ Py_Type(&EventTargetRef_Type) = &PyType_Type;
if (PyType_Ready(&EventTargetRef_Type) < 0) return;
Py_INCREF(&EventTargetRef_Type);
PyModule_AddObject(m, "EventTargetRef", (PyObject *)&EventTargetRef_Type);
/* Backward-compatible name */
Py_INCREF(&EventTargetRef_Type);
PyModule_AddObject(m, "EventTargetRefType", (PyObject *)&EventTargetRef_Type);
- EventHotKeyRef_Type.ob_type = &PyType_Type;
+ Py_Type(&EventHotKeyRef_Type) = &PyType_Type;
if (PyType_Ready(&EventHotKeyRef_Type) < 0) return;
Py_INCREF(&EventHotKeyRef_Type);
PyModule_AddObject(m, "EventHotKeyRef", (PyObject *)&EventHotKeyRef_Type);