From 2312f49a82e5425b3d49d7f020586ac0625d75cc Mon Sep 17 00:00:00 2001 From: James Henstridge Date: Wed, 12 Sep 2001 02:40:02 +0000 Subject: Also, changes to fix up pygtk-demo for this configuration. 2001-09-12 James Henstridge * codegen/codegen.py (write_class, write_interface): set the short name as the class name here. * gobjectmodule.c (pygobject_register_class): pass ec->tp_name as the name for the class passed to PyExtensionClass_Export*. * codegen/codegen.py (write_source): pass the C name to pygobject_register_class again. --- gobject/gobjectmodule.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 1f4ef7a0..9109b8e0 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -181,15 +181,17 @@ pygobject_destroy_notify(gpointer user_data) } static void -pygobject_register_class(PyObject *dict, const gchar *class_name, +pygobject_register_class(PyObject *dict, const gchar *type_name, GType (* get_type)(void), PyExtensionClass *ec, PyObject *bases) { PyObject *o; + const char *class_name; if (!class_hash) class_hash = g_hash_table_new(g_str_hash, g_str_equal); + class_name = ec->tp_name; /* set standard pyobject class functions if they aren't already set */ if (!ec->tp_dealloc) ec->tp_dealloc = (destructor)pygobject_dealloc; if (!ec->tp_getattro) ec->tp_getattro = (getattrofunc)pygobject_getattro; @@ -210,7 +212,7 @@ pygobject_register_class(PyObject *dict, const gchar *class_name, PyDict_SetItemString(ec->class_dictionary, "__gtype__", o); Py_DECREF(o); } - g_hash_table_insert(class_hash, g_strdup(class_name), ec); + g_hash_table_insert(class_hash, g_strdup(type_name), ec); } void -- cgit v1.2.1