mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-24 15:06:38 +00:00
fixed signal registration problem in gobject2gtk shim
Original commit message from CVS: fixed signal registration problem in gobject2gtk shim
This commit is contained in:
parent
8e3911f0da
commit
5e2aec5855
4 changed files with 69 additions and 5 deletions
|
@ -93,7 +93,9 @@ gst_fakesrc_get_type (void)
|
||||||
|
|
||||||
if (!fakesrc_type) {
|
if (!fakesrc_type) {
|
||||||
static const GTypeInfo fakesrc_info = {
|
static const GTypeInfo fakesrc_info = {
|
||||||
sizeof(GstFakeSrcClass), NULL, NULL,
|
sizeof(GstFakeSrcClass),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
(GClassInitFunc)gst_fakesrc_class_init,
|
(GClassInitFunc)gst_fakesrc_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
|
@ -218,3 +218,55 @@ g_param_spec_string(gchar *name,gchar *nick,gchar *blurb,gchar *def,gint flags)
|
||||||
return spec;
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -117,9 +117,17 @@ gpointer g_object_new(GtkType type,gpointer blah_varargs_stuff);
|
||||||
#define GCallback gpointer // FIXME?
|
#define GCallback gpointer // FIXME?
|
||||||
#define G_CALLBACK(f) ((gpointer)(f))
|
#define G_CALLBACK(f) ((gpointer)(f))
|
||||||
|
|
||||||
#define \
|
guint
|
||||||
g_signal_newc(name,type,location,offset,null1,null2,marshal,ret,count,args...) \
|
g_signal_newc (const gchar *signal_name,
|
||||||
gtk_signal_new(name,location,type,offset,marshal,ret,count, ## args )
|
GtkType object_type,
|
||||||
|
GtkSignalRunType signal_flags,
|
||||||
|
guint function_offset,
|
||||||
|
gpointer accumulator, // GSignalAccumulator
|
||||||
|
gpointer accu_data,
|
||||||
|
GtkSignalMarshaller marshaller,
|
||||||
|
GType return_type,
|
||||||
|
guint nparams,
|
||||||
|
...);
|
||||||
|
|
||||||
#define \
|
#define \
|
||||||
g_signal_emit(object,signal,detail,args...) \
|
g_signal_emit(object,signal,detail,args...) \
|
||||||
|
|
|
@ -93,7 +93,9 @@ gst_fakesrc_get_type (void)
|
||||||
|
|
||||||
if (!fakesrc_type) {
|
if (!fakesrc_type) {
|
||||||
static const GTypeInfo fakesrc_info = {
|
static const GTypeInfo fakesrc_info = {
|
||||||
sizeof(GstFakeSrcClass), NULL, NULL,
|
sizeof(GstFakeSrcClass),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
(GClassInitFunc)gst_fakesrc_class_init,
|
(GClassInitFunc)gst_fakesrc_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
Loading…
Reference in a new issue