fixed signal registration problem in gobject2gtk shim

Original commit message from CVS:
fixed signal registration problem in gobject2gtk shim
This commit is contained in:
Erik Walthinsen 2001-06-19 23:17:26 +00:00
parent 8e3911f0da
commit 5e2aec5855
4 changed files with 69 additions and 5 deletions

View file

@ -93,7 +93,9 @@ gst_fakesrc_get_type (void)
if (!fakesrc_type) {
static const GTypeInfo fakesrc_info = {
sizeof(GstFakeSrcClass), NULL, NULL,
sizeof(GstFakeSrcClass),
NULL,
NULL,
(GClassInitFunc)gst_fakesrc_class_init,
NULL,
NULL,

View file

@ -218,3 +218,55 @@ g_param_spec_string(gchar *name,gchar *nick,gchar *blurb,gchar *def,gint flags)
return spec;
}
guint
g_signal_newc (const gchar *name,
GtkType object_type,
GtkSignalRunType signal_flags,
guint function_offset,
gpointer accumulator, // GSignalAccumulator
gpointer accu_data,
GtkSignalMarshaller marshaller,
GType return_val,
guint nparams,
...)
{
GtkType *params;
guint i;
va_list args;
guint signal_id;
#define MAX_SIGNAL_PARAMS (31) // from gtksignal.c
g_return_val_if_fail (nparams < MAX_SIGNAL_PARAMS, 0);
if (nparams > 0)
{
params = g_new (GtkType, nparams);
va_start (args, nparams);
for (i = 0; i < nparams; i++)
params[i] = va_arg (args, GtkType);
va_end (args);
}
else
params = NULL;
signal_id = gtk_signal_newv (name,
signal_flags,
object_type,
function_offset,
marshaller,
return_val,
nparams,
params);
g_free (params);
// now register it.
gtk_object_class_add_signals(gtk_type_class(object_type), &signal_id, 1);
return signal_id;
}

View file

@ -117,9 +117,17 @@ gpointer g_object_new(GtkType type,gpointer blah_varargs_stuff);
#define GCallback gpointer // FIXME?
#define G_CALLBACK(f) ((gpointer)(f))
#define \
g_signal_newc(name,type,location,offset,null1,null2,marshal,ret,count,args...) \
gtk_signal_new(name,location,type,offset,marshal,ret,count, ## args )
guint
g_signal_newc (const gchar *signal_name,
GtkType object_type,
GtkSignalRunType signal_flags,
guint function_offset,
gpointer accumulator, // GSignalAccumulator
gpointer accu_data,
GtkSignalMarshaller marshaller,
GType return_type,
guint nparams,
...);
#define \
g_signal_emit(object,signal,detail,args...) \

View file

@ -93,7 +93,9 @@ gst_fakesrc_get_type (void)
if (!fakesrc_type) {
static const GTypeInfo fakesrc_info = {
sizeof(GstFakeSrcClass), NULL, NULL,
sizeof(GstFakeSrcClass),
NULL,
NULL,
(GClassInitFunc)gst_fakesrc_class_init,
NULL,
NULL,