diff options
author | Tim Janik <timj@src.gnome.org> | 1998-01-24 20:02:19 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-01-24 20:02:19 +0000 |
commit | 6f7faf9df232cf0b0fe52e98e617f36800f6a062 (patch) | |
tree | d31a884de4e32f6e0872f36984311ba0217f4fc2 /gtk/gtkobject.c | |
parent | 3942cb76af880d5bfb23f66499540da199f11c9b (diff) | |
download | gtk+-6f7faf9df232cf0b0fe52e98e617f36800f6a062.tar.gz |
gtk_object_query_args() now returns the args in the corret order.
-timj
Diffstat (limited to 'gtk/gtkobject.c')
-rw-r--r-- | gtk/gtkobject.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c index dac34e7dbc..3887b5d24c 100644 --- a/gtk/gtkobject.c +++ b/gtk/gtkobject.c @@ -52,6 +52,7 @@ struct _GtkArgInfo GtkType type; GtkType class_type; guint arg_id; + guint seq_id; }; @@ -464,28 +465,33 @@ gtk_object_query_args (GtkType class_type, if (query_data.arg_list) { register GList *list; - register guint i; + register guint len; list = query_data.arg_list; - - i = g_list_length (list); - args = g_new0 (GtkArg, i); - *nargs = i; + len = 1; + while (list->next) + { + len++; + list = list->next; + } + g_assert (len == ((GtkObjectClass*) gtk_type_class (class_type))->n_args); /* paranoid */ + + args = g_new0 (GtkArg, len); + *nargs = len; do { GtkArgInfo *info; - i--; info = list->data; - list = list->next; + list = list->prev; - args[i].type = info->type; - args[i].name = info->name; - } - while (i > 0); + g_assert (info->seq_id > 0 && info->seq_id <= len); /* paranoid */ - g_assert (list == NULL); /* paranoid */ + args[info->seq_id - 1].type = info->type; + args[info->seq_id - 1].name = info->name; + } + while (list); g_list_free (query_data.arg_list); } @@ -634,6 +640,8 @@ gtk_object_add_arg_type (const char *arg_name, info->type = arg_type; info->class_type = class_type; info->arg_id = arg_id; + info->seq_id = ++((GtkObjectClass*) gtk_type_class (class_type))->n_args; + printf ("arg seq id: %d for %s\n", info->seq_id, info->name); if (!arg_info_ht) arg_info_ht = g_hash_table_new (g_str_hash, g_str_equal); |