diff options
author | James Henstridge <james@daa.com.au> | 2001-09-14 09:57:27 +0000 |
---|---|---|
committer | James Henstridge <jamesh@src.gnome.org> | 2001-09-14 09:57:27 +0000 |
commit | 3a419d5e5e8877618284d8fc4bf77d67cc62970d (patch) | |
tree | 5885ab15f0e3461cd06bab6d4daa230529b30f0b /gobject | |
parent | da0ecdd18eeedb56ef2575b8ea267cb65cd06c3c (diff) | |
download | pygobject-3a419d5e5e8877618284d8fc4bf77d67cc62970d.tar.gz |
merge from short-class-names-branch
2001-09-14 James Henstridge <james@daa.com.au>
merge from short-class-names-branch
2001-09-12 James Henstridge <james@daa.com.au>
* 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 <james@daa.com.au>
* 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.
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/gobjectmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index bb9ca2b6..4a4a1dea 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 |