summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2000-11-09 10:06:03 +0000
committerJames Henstridge <jamesh@src.gnome.org>2000-11-09 10:06:03 +0000
commitc0f0b3ae57342d1f11a98cdbda10e2d879212a22 (patch)
treef762c9175a50ad8e02053daa227a5e923510516a
parent4b9085e66649cdee646a44fc305e046a1a5622bf (diff)
downloadpygtk-c0f0b3ae57342d1f11a98cdbda10e2d879212a22.tar.gz
change code generator to pass bases in as a tuple rather than a single
2000-11-09 James Henstridge <james@daa.com.au> * codegen/codegen.py (write_source): change code generator to pass bases in as a tuple rather than a single PyExtensionClass structure. * pygobject.h: change prototype. * gobjectmodule.c (pygobject_register_class): allow for registerin a type with multiple base classes.
-rw-r--r--ChangeLog11
-rw-r--r--codegen/codegen.py5
-rw-r--r--gobject/gobjectmodule.c8
-rw-r--r--gobject/pygobject.h2
-rw-r--r--gobjectmodule.c8
-rw-r--r--gtk/gtk.override1
-rw-r--r--pygobject.h2
7 files changed, 25 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index edb59c1b..9ce9736c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-11-09 James Henstridge <james@daa.com.au>
+
+ * codegen/codegen.py (write_source): change code generator to pass
+ bases in as a tuple rather than a single PyExtensionClass
+ structure.
+
+ * pygobject.h: change prototype.
+
+ * gobjectmodule.c (pygobject_register_class): allow for registerin
+ a type with multiple base classes.
+
2000-11-08 James Henstridge <james@daa.com.au>
* codegen/argtypes.py (_conv_special_cases): add a special case
diff --git a/codegen/codegen.py b/codegen/codegen.py
index 1b11cb51..adf1ee62 100644
--- a/codegen/codegen.py
+++ b/codegen/codegen.py
@@ -393,8 +393,9 @@ def write_source(parser, overrides, prefix, fp=sys.stdout):
for obj in parser.objects:
if obj.parent != (None, None):
fp.write(' pygobject_register_class(d, "' + obj.c_name +
- '", &Py' + obj.c_name + '_Type, &Py' + obj.parent[1] +
- obj.parent[0] + '_Type);\n')
+ '", &Py' + obj.c_name +
+ '_Type, Py_BuildValue("(O)", (PyObject *)&Py' +
+ obj.parent[1] + obj.parent[0] + '_Type));\n')
else:
fp.write(' pygobject_register_class(d, "' + obj.c_name +
'", &Py' + obj.c_name + '_Type, NULL);\n')
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 9790a9a5..4eef252c 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -29,7 +29,7 @@ pygobject_destroy_notify(gpointer user_data)
static void
pygobject_register_class(PyObject *dict, const gchar *class_name,
- PyExtensionClass *ec, PyExtensionClass *parent)
+ PyExtensionClass *ec, PyObject *bases)
{
if (!class_hash)
class_hash = g_hash_table_new(g_str_hash, g_str_equal);
@@ -42,9 +42,9 @@ pygobject_register_class(PyObject *dict, const gchar *class_name,
if (!ec->tp_repr) ec->tp_repr = (reprfunc)pygobject_repr;
if (!ec->tp_hash) ec->tp_hash = (hashfunc)pygobject_hash;
- if (parent) {
- PyExtensionClass_ExportSubclassSingle(dict, (char *)class_name,
- *ec, *parent);
+ if (bases) {
+ PyExtensionClass_ExportSubclass(dict, (char *)class_name,
+ *ec, bases);
} else {
PyExtensionClass_Export(dict, (char *)class_name, *ec);
}
diff --git a/gobject/pygobject.h b/gobject/pygobject.h
index 88235144..2e0a7d7e 100644
--- a/gobject/pygobject.h
+++ b/gobject/pygobject.h
@@ -20,7 +20,7 @@ typedef struct {
struct _PyGObject_Functions {
void (* register_class)(PyObject *dict, const gchar *class_name,
- PyExtensionClass *ec, PyExtensionClass *parent);
+ PyExtensionClass *ec, PyObject *bases);
void (* register_wrapper)(PyObject *self);
PyExtensionClass *(* lookup_class)(GType type);
PyObject *(* new)(GObject *obj);
diff --git a/gobjectmodule.c b/gobjectmodule.c
index 9790a9a5..4eef252c 100644
--- a/gobjectmodule.c
+++ b/gobjectmodule.c
@@ -29,7 +29,7 @@ pygobject_destroy_notify(gpointer user_data)
static void
pygobject_register_class(PyObject *dict, const gchar *class_name,
- PyExtensionClass *ec, PyExtensionClass *parent)
+ PyExtensionClass *ec, PyObject *bases)
{
if (!class_hash)
class_hash = g_hash_table_new(g_str_hash, g_str_equal);
@@ -42,9 +42,9 @@ pygobject_register_class(PyObject *dict, const gchar *class_name,
if (!ec->tp_repr) ec->tp_repr = (reprfunc)pygobject_repr;
if (!ec->tp_hash) ec->tp_hash = (hashfunc)pygobject_hash;
- if (parent) {
- PyExtensionClass_ExportSubclassSingle(dict, (char *)class_name,
- *ec, *parent);
+ if (bases) {
+ PyExtensionClass_ExportSubclass(dict, (char *)class_name,
+ *ec, bases);
} else {
PyExtensionClass_Export(dict, (char *)class_name, *ec);
}
diff --git a/gtk/gtk.override b/gtk/gtk.override
index a45ab8ec..4a091852 100644
--- a/gtk/gtk.override
+++ b/gtk/gtk.override
@@ -1657,6 +1657,7 @@ ignore-glob
gtk_binding_*
gtk_gc_*
gtk_signal_*
+ gtk_tree_path_*
%%
ignore
gtk_init
diff --git a/pygobject.h b/pygobject.h
index 88235144..2e0a7d7e 100644
--- a/pygobject.h
+++ b/pygobject.h
@@ -20,7 +20,7 @@ typedef struct {
struct _PyGObject_Functions {
void (* register_class)(PyObject *dict, const gchar *class_name,
- PyExtensionClass *ec, PyExtensionClass *parent);
+ PyExtensionClass *ec, PyObject *bases);
void (* register_wrapper)(PyObject *self);
PyExtensionClass *(* lookup_class)(GType type);
PyObject *(* new)(GObject *obj);