More GObject updates, cleanups to some of the elements to make the port correct.

Original commit message from CVS:
More GObject updates, cleanups to some of the elements to make the port
correct.
This commit is contained in:
Erik Walthinsen 2001-06-19 21:14:08 +00:00
parent c6f02dde10
commit 8e3911f0da
6 changed files with 39 additions and 13 deletions

View file

@ -145,11 +145,11 @@ gst_autoplugger_class_init (GstAutopluggerClass *klass)
/*
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BUFFER_COUNT,
g_param_spec_enum("buffer_count","buffer_count","buffer_count",
G_TYPE_INT,0,G_PARAM_READABLE)); // CHECKME!
g_param_spec_int("buffer_count","buffer_count","buffer_count",
0,G_MAXINT,0,G_PARAM_READABLE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_RESET,
g_param_spec_enum("reset","reset","reset",
G_TYPE_BOOL,0,G_PARAM_WRITABLE)); // CHECKME!
g_param_spec_boolean("reset","reset","reset",
FALSE,G_PARAM_WRITABLE)); // CHECKME!
*/
gobject_class->set_property = gst_autoplugger_set_property;

View file

@ -97,8 +97,8 @@ gst_fdsrc_class_init (GstFdSrcClass *klass)
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATION,
g_param_spec_enum("location","location","location",
GST_TYPE_FILENAME,0,G_PARAM_WRITABLE)); // CHECKME!
g_param_spec_string("location","location","location",
"",G_PARAM_WRITABLE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BYTESPERREAD,
g_param_spec_int("bytesperread","bytesperread","bytesperread",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME

View file

@ -87,10 +87,9 @@ fprintf(stderr,"installing arg \"%s\" into class \"%s\"\n",arg_fullname,"");
}
GParamSpec *
g_object_class_find_property(GtkObjectClass *class,const gchar *name)
g_object_class_find_property(GtkObjectClass *class,gchar *name)
{
GtkArgInfo *info;
gchar *result;
GParamSpec *spec;
fprintf(stderr,"class name is %s\n",gtk_type_name(class->type));
@ -175,6 +174,28 @@ g_param_spec_ulong(gchar *name,gchar *nick,gchar *blurb,gulong min,gulong max,gu
return spec;
}
GParamSpec *
g_param_spec_float(gchar *name,gchar *nick,gchar *blurb,float min,float max,float def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->shortname = name;
spec->value_type = GTK_TYPE_FLOAT;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_double(gchar *name,gchar *nick,gchar *blurb,double min,double max,double def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->shortname = name;
spec->value_type = GTK_TYPE_DOUBLE;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_pointer(gchar *name,gchar *nick,gchar *blurb,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);

View file

@ -115,6 +115,7 @@ gpointer g_object_new(GtkType type,gpointer blah_varargs_stuff);
#define G_SIGNAL_RUN_FIRST GTK_RUN_FIRST
#define GCallback gpointer // FIXME?
#define G_CALLBACK(f) ((gpointer)(f))
#define \
g_signal_newc(name,type,location,offset,null1,null2,marshal,ret,count,args...) \
@ -150,8 +151,10 @@ struct _GParamSpec {
gint flags;
};
#define g_value_init(value,t) ((value)->type = (t))
void g_object_class_install_property(GtkObjectClass *oclass,guint property_id,GParamSpec *pspec);
GParamSpec *g_object_class_find_property(GtkObjectClass *class,const gchar *name);
GParamSpec *g_object_class_find_property(GtkObjectClass *class,gchar *name);
#define G_IS_PARAM_SPEC_ENUM(pspec) (GTK_FUNDAMENTAL_TYPE(pspec->value_type) == GTK_TYPE_ENUM)
@ -160,6 +163,8 @@ GParamSpec *g_param_spec_int(gchar *name,gchar *nick,gchar *blurb,gint min,gint
GParamSpec *g_param_spec_uint(gchar *name,gchar *nick,gchar *blurb,guint min,guint max,guint def,gint flags);
GParamSpec *g_param_spec_long(gchar *name,gchar *nick,gchar *blurb,glong min,glong max,glong def,gint flags);
GParamSpec *g_param_spec_ulong(gchar *name,gchar *nick,gchar *blurb,gulong min,gulong max,gulong def,gint flags);
GParamSpec *g_param_spec_float(gchar *name,gchar *nick,gchar *blurb,float min,float max,float def,gint flags);
GParamSpec *g_param_spec_double(gchar *name,gchar *nick,gchar *blurb,double min,double max,double def,gint flags);
GParamSpec *g_param_spec_enum(gchar *name,gchar *nick,gchar *blurb,GtkType e,guint def,gint flags);
GParamSpec *g_param_spec_pointer(gchar *name,gchar *nick,gchar *blurb,gint flags);
GParamSpec *g_param_spec_string(gchar *name,gchar *nick,gchar *blurb,gchar *def,gint flags);
@ -177,7 +182,7 @@ GParamSpec *g_param_spec_string(gchar *name,gchar *nick,gchar *blurb,gchar *def,
#define g_value_get_ulong(value) GTK_VALUE_ULONG(*value)
#define g_value_set_ulong(value,data) (GTK_VALUE_ULONG(*value) = (data))
#define g_value_get_float(value) GTK_VALUE_FLOAT(*value)
#define g_value_set_float(value,data) (GTK_VALUE_FLAT(*value) = (data))
#define g_value_set_float(value,data) (GTK_VALUE_FLOAT(*value) = (data))
#define g_value_get_double(value) GTK_VALUE_DOUBLE(*value)
#define g_value_set_double(value,data) (GTK_VALUE_DOUBLE(*value) = (data))
#define g_value_get_string(value) GTK_VALUE_STRING(*value)

View file

@ -1595,7 +1595,7 @@ gst_padtemplate_class_init (GstPadTemplateClass *klass)
padtemplate_parent_class = g_type_class_ref(GST_TYPE_OBJECT);
gst_padtemplate_signals[TEMPL_PAD_CREATED] =
g_signal_newc ("pad_created", G_SIGNAL_RUN_LAST, G_TYPE_FROM_CLASS(klass),
g_signal_newc ("pad_created", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstPadTemplateClass, pad_created), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
GST_TYPE_PAD);

View file

@ -97,8 +97,8 @@ gst_fdsrc_class_init (GstFdSrcClass *klass)
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATION,
g_param_spec_enum("location","location","location",
GST_TYPE_FILENAME,0,G_PARAM_WRITABLE)); // CHECKME!
g_param_spec_string("location","location","location",
"",G_PARAM_WRITABLE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BYTESPERREAD,
g_param_spec_int("bytesperread","bytesperread","bytesperread",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME