added gtk_type_query() which returns a newly allocated structure holding

Wed Dec  9 00:49:12 1998  Tim Janik  <timj@gtk.org>

        * 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.
This commit is contained in:
Tim Janik 1998-12-08 23:57:25 +00:00 committed by Tim Janik
parent 847aed3652
commit 9806d64e40
10 changed files with 97 additions and 7 deletions

View File

@ -1,3 +1,11 @@
Wed Dec 9 00:49:12 1998 Tim Janik <timj@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_transient_parent_realized):

View File

@ -1,3 +1,11 @@
Wed Dec 9 00:49:12 1998 Tim Janik <timj@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_transient_parent_realized):

View File

@ -1,3 +1,11 @@
Wed Dec 9 00:49:12 1998 Tim Janik <timj@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_transient_parent_realized):

View File

@ -1,3 +1,11 @@
Wed Dec 9 00:49:12 1998 Tim Janik <timj@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_transient_parent_realized):

View File

@ -1,3 +1,11 @@
Wed Dec 9 00:49:12 1998 Tim Janik <timj@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_transient_parent_realized):

View File

@ -1,3 +1,11 @@
Wed Dec 9 00:49:12 1998 Tim Janik <timj@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_transient_parent_realized):

View File

@ -1,3 +1,11 @@
Wed Dec 9 00:49:12 1998 Tim Janik <timj@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_transient_parent_realized):

View File

@ -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);

View File

@ -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 }

View File

@ -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);