diff --git a/ChangeLog b/ChangeLog index 1cb789ed7f..f6e75a4e5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Dec 9 00:49:12 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly + allocated structure holding certain type specific informations. + fixed the big bunch of `discards const' warnings with the + initialization of enum/flags values. + Tue Dec 8 15:10:17 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_transient_parent_realized): diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 1cb789ed7f..f6e75a4e5d 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +Wed Dec 9 00:49:12 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly + allocated structure holding certain type specific informations. + fixed the big bunch of `discards const' warnings with the + initialization of enum/flags values. + Tue Dec 8 15:10:17 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_transient_parent_realized): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 1cb789ed7f..f6e75a4e5d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Wed Dec 9 00:49:12 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly + allocated structure holding certain type specific informations. + fixed the big bunch of `discards const' warnings with the + initialization of enum/flags values. + Tue Dec 8 15:10:17 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_transient_parent_realized): diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 1cb789ed7f..f6e75a4e5d 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +Wed Dec 9 00:49:12 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly + allocated structure holding certain type specific informations. + fixed the big bunch of `discards const' warnings with the + initialization of enum/flags values. + Tue Dec 8 15:10:17 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_transient_parent_realized): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 1cb789ed7f..f6e75a4e5d 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Wed Dec 9 00:49:12 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly + allocated structure holding certain type specific informations. + fixed the big bunch of `discards const' warnings with the + initialization of enum/flags values. + Tue Dec 8 15:10:17 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_transient_parent_realized): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 1cb789ed7f..f6e75a4e5d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Wed Dec 9 00:49:12 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly + allocated structure holding certain type specific informations. + fixed the big bunch of `discards const' warnings with the + initialization of enum/flags values. + Tue Dec 8 15:10:17 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_transient_parent_realized): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 1cb789ed7f..f6e75a4e5d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Wed Dec 9 00:49:12 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly + allocated structure holding certain type specific informations. + fixed the big bunch of `discards const' warnings with the + initialization of enum/flags values. + Tue Dec 8 15:10:17 1998 Owen Taylor * gtk/gtkwindow.c (gtk_window_transient_parent_realized): diff --git a/gtk/gtksignal.h b/gtk/gtksignal.h index 5287165b64..1b803be0e9 100644 --- a/gtk/gtksignal.h +++ b/gtk/gtksignal.h @@ -180,8 +180,8 @@ void gtk_signal_set_funcs (GtkSignalMarshal marshal_func, GtkSignalDestroy destroy_func); /* Report internal information about a signal. The caller has the - * responsibility to invoke a supsequent g_free (returned_data); but - * must not modify data pointed to by the members of GtkSignalQuery + * responsibility to invoke a subsequent g_free (returned_data); but + * must not modify data pointed to by the members of GtkSignalQuery */ GtkSignalQuery* gtk_signal_query (guint signal_id); diff --git a/gtk/gtktypeutils.c b/gtk/gtktypeutils.c index b7fcf60f5e..6ccc90eaa1 100644 --- a/gtk/gtktypeutils.c +++ b/gtk/gtktypeutils.c @@ -798,9 +798,9 @@ gtk_type_get_varargs_type (GtkType foreign_type) } static inline GtkType -gtk_type_register_intern (gchar *name, - GtkType parent, - GtkEnumValue *values) +gtk_type_register_intern (gchar *name, + GtkType parent, + const GtkEnumValue *values) { GtkType type_id; GtkTypeInfo info; @@ -810,7 +810,7 @@ gtk_type_register_intern (gchar *name, info.class_size = 0; info.class_init_func = NULL; info.object_init_func = NULL; - info.reserved_1 = values; + info.reserved_1 = (gpointer) values; info.reserved_2 = NULL; /* relookup pointers afterwards. @@ -879,6 +879,26 @@ gtk_type_register_flags (const gchar *type_name, return type_id; } +GtkTypeQuery* +gtk_type_query (GtkType type) +{ + GtkTypeNode *node; + + LOOKUP_TYPE_NODE (node, type); + if (node) + { + GtkTypeQuery *query; + + query = g_new0 (GtkTypeQuery, 1); + query->type = type; + query->type_name = node->type_info.type_name; + query->object_size = node->type_info.object_size; + query->class_size = node->type_info.class_size; + } + + return NULL; +} + static guint gtk_type_name_hash (const char *key) { @@ -945,7 +965,7 @@ gtk_type_init_builtin_types (void) gchar *type_name; GtkType *type_id; GtkType parent; - GtkEnumValue *values; + const GtkEnumValue *values; } builtin_info[GTK_TYPE_NUM_BUILTINS + 1] = { #include "gtktypebuiltins_ids.c" /* type entries */ { NULL } diff --git a/gtk/gtktypeutils.h b/gtk/gtktypeutils.h index 40e70c2c40..42bf9d8093 100644 --- a/gtk/gtktypeutils.h +++ b/gtk/gtktypeutils.h @@ -132,6 +132,7 @@ GtkType gtk_identifier_get_type (void); typedef struct _GtkArg GtkArg; typedef struct _GtkObject GtkObject; /* forward declaration of object type */ typedef struct _GtkTypeInfo GtkTypeInfo; +typedef struct _GtkTypeQuery GtkTypeQuery; typedef struct _GtkEnumValue GtkEnumValue; typedef struct _GtkEnumValue GtkFlagValue; @@ -302,6 +303,14 @@ struct _GtkTypeInfo GtkClassInitFunc base_class_init_func; }; +struct _GtkTypeQuery +{ + GtkType type; + const gchar *type_name; + guint object_size; + guint class_size; +}; + struct _GtkEnumValue { guint value; @@ -347,6 +356,11 @@ GtkFlagValue* gtk_type_flags_find_value (GtkType flag_type, void gtk_type_set_varargs_type (GtkType foreign_type, GtkType varargs_type); GtkType gtk_type_get_varargs_type (GtkType foreign_type); +/* Report internal information about a type. The caller has the + * responsibility to invoke a subsequent g_free (returned_data); but + * must not modify data pointed to by the members of GtkTypeQuery + */ +GtkTypeQuery* gtk_type_query (GtkType type);