]> granicus.if.org Git - python/commitdiff
Export type objects to Python
authorJack Jansen <jack.jansen@cwi.nl>
Sat, 20 Sep 1997 17:40:22 +0000 (17:40 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Sat, 20 Sep 1997 17:40:22 +0000 (17:40 +0000)
19 files changed:
Mac/Modules/ae/AEmodule.c
Mac/Modules/cm/Cmmodule.c
Mac/Modules/ctbmodule.c
Mac/Modules/ctl/Ctlmodule.c
Mac/Modules/ctl/ctledit.py
Mac/Modules/dlg/Dlgmodule.c
Mac/Modules/help/Helpmodule.c
Mac/Modules/help/helpsupport.py
Mac/Modules/list/Listmodule.c
Mac/Modules/macfsmodule.c
Mac/Modules/macosmodule.c
Mac/Modules/menu/Menumodule.c
Mac/Modules/qd/Qdmodule.c
Mac/Modules/qt/Qtmodule.c
Mac/Modules/res/Resmodule.c
Mac/Modules/snd/Sndmodule.c
Mac/Modules/te/TEmodule.c
Mac/Modules/waste/wastemodule.c
Mac/Modules/win/Winmodule.c

index a2a8b14ac77357b18fd685ac9be25084f0a70818..ed20b40aa2d99d016ff9264300c2d4ed7ab96ced 100644 (file)
@@ -1180,6 +1180,10 @@ void initAE()
        if (AE_Error == NULL ||
            PyDict_SetItemString(d, "Error", AE_Error) != 0)
                Py_FatalError("can't initialize AE.Error");
+       AEDesc_Type.ob_type = &PyType_Type;
+       Py_INCREF(&AEDesc_Type);
+       if (PyDict_SetItemString(d, "AEDescType", (PyObject *)&AEDesc_Type) != 0)
+               Py_FatalError("can't initialize AEDescType");
 }
 
 /* ========================= End module AE ========================== */
index 93aab4501d718b51036900c9b008bbb1c8a0410f..fe35685f4d5c1370b3c65a76e22b097bbaf16cbb 100644 (file)
@@ -761,6 +761,14 @@ void initCm()
        if (Cm_Error == NULL ||
            PyDict_SetItemString(d, "Error", Cm_Error) != 0)
                Py_FatalError("can't initialize Cm.Error");
+       ComponentInstance_Type.ob_type = &PyType_Type;
+       Py_INCREF(&ComponentInstance_Type);
+       if (PyDict_SetItemString(d, "ComponentInstanceType", (PyObject *)&ComponentInstance_Type) != 0)
+               Py_FatalError("can't initialize ComponentInstanceType");
+       Component_Type.ob_type = &PyType_Type;
+       Py_INCREF(&Component_Type);
+       if (PyDict_SetItemString(d, "ComponentType", (PyObject *)&Component_Type) != 0)
+               Py_FatalError("can't initialize ComponentType");
 }
 
 /* ========================= End module Cm ========================== */
index 907b7bb7c6a85288be8151eb728208a4f37f218d..6eabca96e5f96fd0d5cb5550330b8e4a6f809a2e 100644 (file)
@@ -478,7 +478,7 @@ ctbcm_setattr(self, name, v)
 statichere PyTypeObject ctbcmtype = {
        PyObject_HEAD_INIT(&PyType_Type)
        0,                      /*ob_size*/
-       "ctbcm",                        /*tp_name*/
+       "CTBConnectionMgr",     /*tp_name*/
        sizeof(ctbcmobject),    /*tp_basicsize*/
        0,                      /*tp_itemsize*/
        /* methods */
@@ -608,6 +608,9 @@ initctb()
        
        ErrorObject = PyString_FromString("ctb.error");
        PyDict_SetItemString(d, "error", ErrorObject);
+       ctbcmtype.ob_type = &PyType_Type;
+       Py_INCREF(&ctbcmtype);
+       PyDict_SetItemString(d, "CTBConnectionMgrType", (PyObject *)&ctbcmtype);
 
        /* Check for errors */
        if (PyErr_Occurred())
index 654f671c305e3ec8d3b121381272720e177c3980..573f581fb90eb9b27249fd7318e346b535fabfa9 100644 (file)
@@ -733,6 +733,10 @@ void initCtl()
        if (Ctl_Error == NULL ||
            PyDict_SetItemString(d, "Error", Ctl_Error) != 0)
                Py_FatalError("can't initialize Ctl.Error");
+       Control_Type.ob_type = &PyType_Type;
+       Py_INCREF(&Control_Type);
+       if (PyDict_SetItemString(d, "ControlType", (PyObject *)&Control_Type) != 0)
+               Py_FatalError("can't initialize ControlType");
 }
 
 /* ========================= End module Ctl ========================= */
index 9240851bb4e509aea9c6069162f0a007621196fe..a23eef8e62c3b77b5e58df8331a9d6527e450e8d 100644 (file)
@@ -11,7 +11,7 @@ DisposeControl_body = """
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        if ( _self->ob_itself ) {
-               SetCRefCon(_self->ob_itself, (long)0); /* Make it forget about us */
+               SetControlReference(_self->ob_itself, (long)0); /* Make it forget about us */
                DisposeControl(_self->ob_itself);
                _self->ob_itself = NULL;
        }
index 5949ea10ae540c53d4794c7b49511929bdd4c810..7ca2a59947748b18a149f4c1597c4c02da44282a 100644 (file)
@@ -1008,6 +1008,10 @@ void initDlg()
        if (Dlg_Error == NULL ||
            PyDict_SetItemString(d, "Error", Dlg_Error) != 0)
                Py_FatalError("can't initialize Dlg.Error");
+       Dialog_Type.ob_type = &PyType_Type;
+       Py_INCREF(&Dialog_Type);
+       if (PyDict_SetItemString(d, "DialogType", (PyObject *)&Dialog_Type) != 0)
+               Py_FatalError("can't initialize DialogType");
 }
 
 /* ========================= End module Dlg ========================= */
index aac22ad71fe4d4ba36e1137f1b47f06822ee9bb6..e6cb0a286e2966936b25bd70db8196f450d5124a 100644 (file)
@@ -60,7 +60,7 @@ static PyObject *Help_HMGetHelpMenuHandle(_self, _args)
        _err = HMGetHelpMenuHandle(&mh);
        if (_err != noErr) return PyMac_Error(_err);
        _res = Py_BuildValue("O&",
-                            ResObj_New, mh);
+                            MenuObj_New, mh);
        return _res;
 }
 
index 570ac32056616e4d5c0e7aebd92c77da89388d50..1e7ac84d4d42d2cf89e5f1435e86c868df751a60 100644 (file)
@@ -21,7 +21,7 @@ OUTPUTFILE = MODNAME + "module.c"     # The file generated by this program
 from macsupport import *
 
 # Create the type objects
-MenuRef = OpaqueByValueType("MenuRef", "ResObj")
+MenuRef = OpaqueByValueType("MenuRef", "MenuObj")
 
 
 #WindowPeek = OpaqueByValueType("WindowPeek", OBJECTPREFIX)
index b0ce515b0b8b36f6f23c4140f2ac81ff1aad4a18..e0eace926a82bd5b024001a2ca7505163f5b5c34 100644 (file)
@@ -673,6 +673,10 @@ void initList()
        if (List_Error == NULL ||
            PyDict_SetItemString(d, "Error", List_Error) != 0)
                Py_FatalError("can't initialize List.Error");
+       List_Type.ob_type = &PyType_Type;
+       Py_INCREF(&List_Type);
+       if (PyDict_SetItemString(d, "ListType", (PyObject *)&List_Type) != 0)
+               Py_FatalError("can't initialize ListType");
 }
 
 /* ======================== End module List ========================= */
index 4bea8ce5ce8b03a3bdf100b967ef9574b4526086..2c5af1ef01656cd186e47b27bbb49673fd6925ea 100644 (file)
@@ -313,7 +313,7 @@ mfsi_setattr(self, name, v)
 static PyTypeObject Mfsitype = {
        PyObject_HEAD_INIT(&PyType_Type)
        0,                              /*ob_size*/
-       "FInfo object",                 /*tp_name*/
+       "FInfo",                        /*tp_name*/
        sizeof(mfsiobject),             /*tp_basicsize*/
        0,                              /*tp_itemsize*/
        /* methods */
@@ -982,6 +982,15 @@ initmacfs()
        ErrorObject = PyString_FromString("macfs.error");
        PyDict_SetItemString(d, "error", ErrorObject);
 
+       Mfsatype.ob_type = &PyType_Type;
+       Py_INCREF(&Mfsatype);
+       PyDict_SetItemString(d, "AliasType", (PyObject *)&Mfsatype);
+       Mfsstype.ob_type = &PyType_Type;
+       Py_INCREF(&Mfsstype);
+       PyDict_SetItemString(d, "FSSpecType", (PyObject *)&Mfsstype);
+       Mfsitype.ob_type = &PyType_Type;
+       Py_INCREF(&Mfsitype);
+       PyDict_SetItemString(d, "FInfoType", (PyObject *)&Mfsitype);
        /* XXXX Add constants here */
        
        /* Check for errors */
index 1717d39e4aceb707acb09fb91268b5198392f0f7..6fc3cf4e7034138140f1483f16f99366803c0ce5 100644 (file)
@@ -278,7 +278,7 @@ static char Rftype__doc__[] =
 static PyTypeObject Rftype = {
        PyObject_HEAD_INIT(&PyType_Type)
        0,                              /*ob_size*/
-       "Resource fork",                        /*tp_name*/
+       "ResourceFork",                 /*tp_name*/
        sizeof(rfobject),               /*tp_basicsize*/
        0,                              /*tp_itemsize*/
        /* methods */
@@ -716,6 +716,10 @@ MacOS_Init()
        MacOS_Error = PyMac_GetOSErrException();
        if (MacOS_Error == NULL || PyDict_SetItemString(d, "Error", MacOS_Error) != 0)
                Py_FatalError("can't define MacOS.Error");
+       Rftype.ob_type = &PyType_Type;
+       Py_INCREF(&Rftype);
+       if (PyDict_SetItemString(d, "ResourceForkType", (PyObject *)&Rftype) != 0)
+               Py_FatalError("can't define MacOS.ResourceForkType");
        /*
        ** This is a hack: the following constant added to the id() of a string
        ** object gives you the address of the data. Unfortunately, it is needed for
index ac52e39eb25941d1ca3ff113425cd0db9ab0e38f..b09d47d8bd23b05b18ab988ea2489c576c743ac4 100644 (file)
@@ -1038,6 +1038,10 @@ void initMenu()
        if (Menu_Error == NULL ||
            PyDict_SetItemString(d, "Error", Menu_Error) != 0)
                Py_FatalError("can't initialize Menu.Error");
+       Menu_Type.ob_type = &PyType_Type;
+       Py_INCREF(&Menu_Type);
+       if (PyDict_SetItemString(d, "MenuType", (PyObject *)&Menu_Type) != 0)
+               Py_FatalError("can't initialize MenuType");
 }
 
 /* ======================== End module Menu ========================= */
index ee69274595bde2fb7f5827b3200f2691f0560950..f294d318ea730bc9c92197662b6bd57a5eec28c5 100644 (file)
@@ -4265,6 +4265,18 @@ void initQd()
        if (Qd_Error == NULL ||
            PyDict_SetItemString(d, "Error", Qd_Error) != 0)
                Py_FatalError("can't initialize Qd.Error");
+       GrafPort_Type.ob_type = &PyType_Type;
+       Py_INCREF(&GrafPort_Type);
+       if (PyDict_SetItemString(d, "GrafPortType", (PyObject *)&GrafPort_Type) != 0)
+               Py_FatalError("can't initialize GrafPortType");
+       BitMap_Type.ob_type = &PyType_Type;
+       Py_INCREF(&BitMap_Type);
+       if (PyDict_SetItemString(d, "BitMapType", (PyObject *)&BitMap_Type) != 0)
+               Py_FatalError("can't initialize BitMapType");
+       QDGlobalsAccess_Type.ob_type = &PyType_Type;
+       Py_INCREF(&QDGlobalsAccess_Type);
+       if (PyDict_SetItemString(d, "QDGlobalsAccessType", (PyObject *)&QDGlobalsAccess_Type) != 0)
+               Py_FatalError("can't initialize QDGlobalsAccessType");
 
        {
                PyObject *o;
index 9b2a854319917945417bdebba9bf62014f442fad..a0a03e2ea0a57ebdfaae507433f4918298608ac3 100644 (file)
@@ -6047,6 +6047,30 @@ void initQt()
        if (Qt_Error == NULL ||
            PyDict_SetItemString(d, "Error", Qt_Error) != 0)
                Py_FatalError("can't initialize Qt.Error");
+       MovieController_Type.ob_type = &PyType_Type;
+       Py_INCREF(&MovieController_Type);
+       if (PyDict_SetItemString(d, "MovieControllerType", (PyObject *)&MovieController_Type) != 0)
+               Py_FatalError("can't initialize MovieControllerType");
+       TimeBase_Type.ob_type = &PyType_Type;
+       Py_INCREF(&TimeBase_Type);
+       if (PyDict_SetItemString(d, "TimeBaseType", (PyObject *)&TimeBase_Type) != 0)
+               Py_FatalError("can't initialize TimeBaseType");
+       UserData_Type.ob_type = &PyType_Type;
+       Py_INCREF(&UserData_Type);
+       if (PyDict_SetItemString(d, "UserDataType", (PyObject *)&UserData_Type) != 0)
+               Py_FatalError("can't initialize UserDataType");
+       Media_Type.ob_type = &PyType_Type;
+       Py_INCREF(&Media_Type);
+       if (PyDict_SetItemString(d, "MediaType", (PyObject *)&Media_Type) != 0)
+               Py_FatalError("can't initialize MediaType");
+       Track_Type.ob_type = &PyType_Type;
+       Py_INCREF(&Track_Type);
+       if (PyDict_SetItemString(d, "TrackType", (PyObject *)&Track_Type) != 0)
+               Py_FatalError("can't initialize TrackType");
+       Movie_Type.ob_type = &PyType_Type;
+       Py_INCREF(&Movie_Type);
+       if (PyDict_SetItemString(d, "MovieType", (PyObject *)&Movie_Type) != 0)
+               Py_FatalError("can't initialize MovieType");
 }
 
 /* ========================= End module Qt ========================== */
index e903158cf126193e84233cebd7ad42ecb4df4c33..f4ed648deab3ea3258931b14339a173783bb8f23 100644 (file)
@@ -1387,6 +1387,10 @@ void initRes()
        if (Res_Error == NULL ||
            PyDict_SetItemString(d, "Error", Res_Error) != 0)
                Py_FatalError("can't initialize Res.Error");
+       Resource_Type.ob_type = &PyType_Type;
+       Py_INCREF(&Resource_Type);
+       if (PyDict_SetItemString(d, "ResourceType", (PyObject *)&Resource_Type) != 0)
+               Py_FatalError("can't initialize ResourceType");
 }
 
 /* ========================= End module Res ========================= */
index 74951ce0726dfe2062b8f2a145e8666173685854..36d9fd2b36647fc0c11fd7a1e9e95113e44be93d 100644 (file)
@@ -797,6 +797,10 @@ void initSnd()
        if (Snd_Error == NULL ||
            PyDict_SetItemString(d, "Error", Snd_Error) != 0)
                Py_FatalError("can't initialize Snd.Error");
+       SndChannel_Type.ob_type = &PyType_Type;
+       Py_INCREF(&SndChannel_Type);
+       if (PyDict_SetItemString(d, "SndChannelType", (PyObject *)&SndChannel_Type) != 0)
+               Py_FatalError("can't initialize SndChannelType");
 }
 
 /* ========================= End module Snd ========================= */
index 3a5a062c1c29cb4d3baa721c3d0a52279ec62648..611c262d8e1d5fa94cde97678f6bbc4e6f004efb 100644 (file)
@@ -1034,6 +1034,10 @@ void initTE()
        if (TE_Error == NULL ||
            PyDict_SetItemString(d, "Error", TE_Error) != 0)
                Py_FatalError("can't initialize TE.Error");
+       TE_Type.ob_type = &PyType_Type;
+       Py_INCREF(&TE_Type);
+       if (PyDict_SetItemString(d, "TEType", (PyObject *)&TE_Type) != 0)
+               Py_FatalError("can't initialize TEType");
 }
 
 /* ========================= End module TE ========================== */
index a832957153ef8fb27aa5ddbb60edb6ed62bac984..32bb7e70cdb8bb84ca21f02012a5100ddc2d2e1e 100644 (file)
@@ -43,8 +43,8 @@ extern int BMObj_Convert(PyObject *, BitMapPtr *);
 extern PyObject *WinObj_WhichWindow(WindowPtr);
 
 #include <WASTE.h>
-#include <WETabs.h>
 #include <WEObjectHandlers.h>
+#include <WETabs.h>
 
 /* Exported by Qdmodule.c: */
 extern PyObject *QdRGB_New(RGBColor *);
@@ -1986,6 +1986,14 @@ void initwaste()
        if (waste_Error == NULL ||
            PyDict_SetItemString(d, "Error", waste_Error) != 0)
                Py_FatalError("can't initialize waste.Error");
+       WEO_Type.ob_type = &PyType_Type;
+       Py_INCREF(&WEO_Type);
+       if (PyDict_SetItemString(d, "WEOType", (PyObject *)&WEO_Type) != 0)
+               Py_FatalError("can't initialize WEOType");
+       waste_Type.ob_type = &PyType_Type;
+       Py_INCREF(&waste_Type);
+       if (PyDict_SetItemString(d, "wasteType", (PyObject *)&waste_Type) != 0)
+               Py_FatalError("can't initialize wasteType");
 
                callbackdict = PyDict_New();
                if (callbackdict == NULL || PyDict_SetItemString(d, "callbacks", callbackdict) != 0)
index 7077b12d6a04d77a0f939004b4a74f14872db01a..eb5b046b46cfac090a852f0bf34b399630db65d0 100644 (file)
@@ -1402,6 +1402,10 @@ void initWin()
        if (Win_Error == NULL ||
            PyDict_SetItemString(d, "Error", Win_Error) != 0)
                Py_FatalError("can't initialize Win.Error");
+       Window_Type.ob_type = &PyType_Type;
+       Py_INCREF(&Window_Type);
+       if (PyDict_SetItemString(d, "WindowType", (PyObject *)&Window_Type) != 0)
+               Py_FatalError("can't initialize WindowType");
 }
 
 /* ========================= End module Win ========================= */