void _pymatecomponent_register_boxed_types(PyObject *moddict) { pyg_register_boxed_custom(MATECOMPONENT_TYPE_CORBA_ANY, pymatecomponent_corbaany_from_value, pymatecomponent_corbaany_to_value); pyg_register_boxed_custom(MATECOMPONENT_TYPE_CORBA_TYPECODE, pymatecomponent_corbatypecode_from_value, pymatecomponent_corbatypecode_to_value); pyg_register_boxed_custom(MATECOMPONENT_TYPE_CORBA_OBJECT, pymatecomponent_corbaobject_from_value, pymatecomponent_corbaobject_to_value); pyg_register_boxed_custom(MATECOMPONENT_TYPE_UNKNOWN, pymatecomponent_corbaobject_from_value, pymatecomponent_unknown_to_value); }
initgnomecanvas (void) { PyObject *m, *d; init_pygobject (); init_pygtk (); pyg_register_boxed_custom(GNOME_TYPE_CANVAS_POINTS, gnomecanvaspoints_from_value, gnomecanvaspoints_to_value); m = Py_InitModule ("gnomecanvas", pycanvas_functions); d = PyModule_GetDict (m); /* ArtPathcode */ #define add_item(short)\ PyModule_AddIntConstant (m, #short, ART_##short) add_item(MOVETO); add_item(MOVETO_OPEN); add_item(CURVETO); add_item(LINETO); add_item(END); #undef add_item pycanvas_register_classes (d); /* pycanvas_add_constants (d, "GNOME_CANVAS_"); */ }
/* We have to set ob_type here because stupid win32 does not allow you * to use variables from another dll in a global variable initialisation. */ void _pygtk_register_boxed_types(PyObject *moddict) { PyGtkStyleHelper_Type.ob_type = &PyType_Type; PyGtkRcStyleHelper_Type.ob_type = &PyType_Type; PyGdkAtom_Type.ob_type = &PyType_Type; PyGtkTreeModelRow_Type.ob_type = &PyType_Type; PyGtkTreeModelRowIter_Type.ob_type = &PyType_Type; PyType_Ready(&PyGtkStyleHelper_Type); PyType_Ready(&PyGtkRcStyleHelper_Type); PyType_Ready(&PyGdkAtom_Type); PyType_Ready(&PyGtkTreeModelRow_Type); PyType_Ready(&PyGtkTreeModelRowIter_Type); PyDict_SetItemString(moddict, "GdkAtomType", (PyObject *)&PyGdkAtom_Type); pyg_register_boxed_custom(GTK_TYPE_TREE_PATH, PyGtkTreePath_from_value, PyGtkTreePath_to_value); pyg_register_boxed_custom(GDK_TYPE_RECTANGLE, PyGdkRectangle_from_value, PyGdkRectangle_to_value); }
gboolean _moo_module_init (void) { PyObject *_moo_module = NULL; init_pygtk_mod (); if (PyErr_Occurred ()) return FALSE; pyg_register_boxed_custom (MOO_TYPE_PY_OBJECT, py_object_from_moo_py_object, py_object_to_moo_py_object); if (PyErr_Occurred ()) return FALSE; _moo_module = Py_InitModule3 ("_moo", (PyMethodDef*) _moo_functions, (char*) _moo_module_doc); if (!_moo_module) return FALSE; PyModule_AddObject (_moo_module, "version", moo_version()); if (PyErr_Occurred ()) return FALSE; PyModule_AddObject (_moo_module, "detailed_version", moo_detailed_version()); if (PyErr_Occurred ()) return FALSE; init_moo_utils (_moo_module); if (PyErr_Occurred ()) return FALSE; _moo_add_constants (_moo_module, "MOO_"); if (PyErr_Occurred ()) return FALSE; _moo_register_classes (PyModule_GetDict (_moo_module)); if (PyErr_Occurred ()) return FALSE; return TRUE; }