From 3a419d5e5e8877618284d8fc4bf77d67cc62970d Mon Sep 17 00:00:00 2001 From: James Henstridge Date: Fri, 14 Sep 2001 09:57:27 +0000 Subject: merge from short-class-names-branch 2001-09-14 James Henstridge merge from short-class-names-branch 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. 2001-09-11 James Henstridge * gtk/__init__.py (create_pixmap): few fixups to get things to import correctly. * gtk/gtkmodule.c (init_gtk): there is no _pygdk_register_boxed(). * gtk/libglade.override (init): same here. * gtk/gtk.override (init): same here. * gtk/gdk.override (init): use short class names here. * gtk/gtkmodule.c (init_gtk): initialise both the gtk._gtk and gtk.gdk modules. * gtk/gtk.defs: don't include gdk.defs * gtk/gtk.override: remove all GDK override wrappers. * gtk/gdk.override: new file taking the overrides for GDK functions. * codegen/codegen.py (write_source): register only the short name of the GObject, interface or boxed type. --- gobject/gobjectmodule.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index bb9ca2b..4a4a1de 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