for unknown foreign fundamental types, collect an argument of the type

Sat Oct  3 17:54:48 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkargcollector.c (GTK_ARG_COLLECT_VALUE): for unknown foreign
        fundamental types, collect an argument of the type returned from
        gtk_type_get_varargs_type(). removed the first macro argument which
        was just the same as the fundamental type of the *arg passed to
        the macro.
        * gtk/gtkarg.c (gtk_args_collect):
        * gtk/gtksignal.c (gtk_signal_collect_params): changed callers.

        * gtk/gtktypeutils.h:
        * gtk/gtktypeutils.c: new functions gtk_type_set_varargs_type() and
        gtk_type_get_varargs_type() to set and query the varargs collect
        type used for a fundamental type, registered outside of Gtk.

        * gtk/gtkmisc.c (gtk_misc_class_init): changed object arguments
        GtkMisc::xalign and GtkMisc::yalign from GTK_TYPE_DOUBLE to
        GTK_TYPE_FLOAT.

        * gtk/gtkframe.c (gtk_frame_class_init): changed object arguments
        GtkFrame::label_xalign and GtkFrame::label_yalign from GTK_TYPE_DOUBLE
        to GTK_TYPE_FLOAT.
This commit is contained in:
Tim Janik
1998-10-03 17:04:41 +00:00
committed by Tim Janik
parent 879683b674
commit c62ab96bcc
14 changed files with 255 additions and 21 deletions

View File

@ -20,16 +20,23 @@
/* collect a single argument value from a va_list.
* this is implemented as a huge macro <shrug>, because we can't
* pass va_list variables by reference on some systems.
* the former prototype was:
* the corresponding prototype would be:
* static inline gchar*
* gtk_arg_collect_value (GtkType fundamental_type,
* GtkArg *arg,
* gtk_arg_collect_value (GtkArg *arg,
* va_list var_args);
*/
#define GTK_ARG_COLLECT_VALUE(_ft, arg, var_args, _error) \
#define GTK_ARG_COLLECT_VALUE(arg, var_args, _error) \
G_STMT_START { \
GtkType fundamental_type = _ft; \
gchar *error_msg; \
GtkType fundamental_type; \
\
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type); \
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST) \
{ \
fundamental_type = gtk_type_get_varargs_type (fundamental_type); \
if (!fundamental_type) \
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type); \
} \
\
error_msg = NULL; \
switch (fundamental_type) \