Skip to content

Commit 8f5f5ae

Browse files
author
jack
committed
Export type objects to Python
git-svn-id: http://svn.python.org/projects/python/trunk@8807 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent ddbf8c8 commit 8f5f5ae

19 files changed

Lines changed: 111 additions & 7 deletions

Mac/Modules/ae/AEmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,10 @@ void initAE()
11801180
if (AE_Error == NULL ||
11811181
PyDict_SetItemString(d, "Error", AE_Error) != 0)
11821182
Py_FatalError("can't initialize AE.Error");
1183+
AEDesc_Type.ob_type = &PyType_Type;
1184+
Py_INCREF(&AEDesc_Type);
1185+
if (PyDict_SetItemString(d, "AEDescType", (PyObject *)&AEDesc_Type) != 0)
1186+
Py_FatalError("can't initialize AEDescType");
11831187
}
11841188

11851189
/* ========================= End module AE ========================== */

Mac/Modules/cm/Cmmodule.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,14 @@ void initCm()
761761
if (Cm_Error == NULL ||
762762
PyDict_SetItemString(d, "Error", Cm_Error) != 0)
763763
Py_FatalError("can't initialize Cm.Error");
764+
ComponentInstance_Type.ob_type = &PyType_Type;
765+
Py_INCREF(&ComponentInstance_Type);
766+
if (PyDict_SetItemString(d, "ComponentInstanceType", (PyObject *)&ComponentInstance_Type) != 0)
767+
Py_FatalError("can't initialize ComponentInstanceType");
768+
Component_Type.ob_type = &PyType_Type;
769+
Py_INCREF(&Component_Type);
770+
if (PyDict_SetItemString(d, "ComponentType", (PyObject *)&Component_Type) != 0)
771+
Py_FatalError("can't initialize ComponentType");
764772
}
765773

766774
/* ========================= End module Cm ========================== */

Mac/Modules/ctbmodule.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ ctbcm_setattr(self, name, v)
478478
statichere PyTypeObject ctbcmtype = {
479479
PyObject_HEAD_INIT(&PyType_Type)
480480
0, /*ob_size*/
481-
"ctbcm", /*tp_name*/
481+
"CTBConnectionMgr", /*tp_name*/
482482
sizeof(ctbcmobject), /*tp_basicsize*/
483483
0, /*tp_itemsize*/
484484
/* methods */
@@ -608,6 +608,9 @@ initctb()
608608

609609
ErrorObject = PyString_FromString("ctb.error");
610610
PyDict_SetItemString(d, "error", ErrorObject);
611+
ctbcmtype.ob_type = &PyType_Type;
612+
Py_INCREF(&ctbcmtype);
613+
PyDict_SetItemString(d, "CTBConnectionMgrType", (PyObject *)&ctbcmtype);
611614

612615
/* Check for errors */
613616
if (PyErr_Occurred())

Mac/Modules/ctl/Ctlmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,10 @@ void initCtl()
733733
if (Ctl_Error == NULL ||
734734
PyDict_SetItemString(d, "Error", Ctl_Error) != 0)
735735
Py_FatalError("can't initialize Ctl.Error");
736+
Control_Type.ob_type = &PyType_Type;
737+
Py_INCREF(&Control_Type);
738+
if (PyDict_SetItemString(d, "ControlType", (PyObject *)&Control_Type) != 0)
739+
Py_FatalError("can't initialize ControlType");
736740
}
737741

738742
/* ========================= End module Ctl ========================= */

Mac/Modules/ctl/ctledit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
if (!PyArg_ParseTuple(_args, ""))
1212
return NULL;
1313
if ( _self->ob_itself ) {
14-
SetCRefCon(_self->ob_itself, (long)0); /* Make it forget about us */
14+
SetControlReference(_self->ob_itself, (long)0); /* Make it forget about us */
1515
DisposeControl(_self->ob_itself);
1616
_self->ob_itself = NULL;
1717
}

Mac/Modules/dlg/Dlgmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,10 @@ void initDlg()
10081008
if (Dlg_Error == NULL ||
10091009
PyDict_SetItemString(d, "Error", Dlg_Error) != 0)
10101010
Py_FatalError("can't initialize Dlg.Error");
1011+
Dialog_Type.ob_type = &PyType_Type;
1012+
Py_INCREF(&Dialog_Type);
1013+
if (PyDict_SetItemString(d, "DialogType", (PyObject *)&Dialog_Type) != 0)
1014+
Py_FatalError("can't initialize DialogType");
10111015
}
10121016

10131017
/* ========================= End module Dlg ========================= */

Mac/Modules/help/Helpmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static PyObject *Help_HMGetHelpMenuHandle(_self, _args)
6060
_err = HMGetHelpMenuHandle(&mh);
6161
if (_err != noErr) return PyMac_Error(_err);
6262
_res = Py_BuildValue("O&",
63-
ResObj_New, mh);
63+
MenuObj_New, mh);
6464
return _res;
6565
}
6666

Mac/Modules/help/helpsupport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from macsupport import *
2222

2323
# Create the type objects
24-
MenuRef = OpaqueByValueType("MenuRef", "ResObj")
24+
MenuRef = OpaqueByValueType("MenuRef", "MenuObj")
2525

2626

2727
#WindowPeek = OpaqueByValueType("WindowPeek", OBJECTPREFIX)

Mac/Modules/list/Listmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,10 @@ void initList()
673673
if (List_Error == NULL ||
674674
PyDict_SetItemString(d, "Error", List_Error) != 0)
675675
Py_FatalError("can't initialize List.Error");
676+
List_Type.ob_type = &PyType_Type;
677+
Py_INCREF(&List_Type);
678+
if (PyDict_SetItemString(d, "ListType", (PyObject *)&List_Type) != 0)
679+
Py_FatalError("can't initialize ListType");
676680
}
677681

678682
/* ======================== End module List ========================= */

Mac/Modules/macfsmodule.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ mfsi_setattr(self, name, v)
313313
static PyTypeObject Mfsitype = {
314314
PyObject_HEAD_INIT(&PyType_Type)
315315
0, /*ob_size*/
316-
"FInfo object", /*tp_name*/
316+
"FInfo", /*tp_name*/
317317
sizeof(mfsiobject), /*tp_basicsize*/
318318
0, /*tp_itemsize*/
319319
/* methods */
@@ -982,6 +982,15 @@ initmacfs()
982982
ErrorObject = PyString_FromString("macfs.error");
983983
PyDict_SetItemString(d, "error", ErrorObject);
984984

985+
Mfsatype.ob_type = &PyType_Type;
986+
Py_INCREF(&Mfsatype);
987+
PyDict_SetItemString(d, "AliasType", (PyObject *)&Mfsatype);
988+
Mfsstype.ob_type = &PyType_Type;
989+
Py_INCREF(&Mfsstype);
990+
PyDict_SetItemString(d, "FSSpecType", (PyObject *)&Mfsstype);
991+
Mfsitype.ob_type = &PyType_Type;
992+
Py_INCREF(&Mfsitype);
993+
PyDict_SetItemString(d, "FInfoType", (PyObject *)&Mfsitype);
985994
/* XXXX Add constants here */
986995

987996
/* Check for errors */

0 commit comments

Comments
 (0)