Commit 704c3be2 authored by Wim Taymans's avatar Wim Taymans
Browse files

Fixed the utils for getting properties.

Original commit message from CVS:
Fixed the utils for getting properties.
Added come const directives to the arguments.
parent 12107586
......@@ -37,10 +37,11 @@
* Returns: the property of the object
*/
gint
gst_util_get_int_arg (GObject *object,gchar *argname)
gst_util_get_int_arg (GObject *object, const gchar *argname)
{
GValue value;
g_value_init (&value, G_TYPE_INT);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_int(&value);
}
......@@ -55,10 +56,11 @@ gst_util_get_int_arg (GObject *object,gchar *argname)
* Returns: the property of the object
*/
gint
gst_util_get_bool_arg (GObject *object,gchar *argname)
gst_util_get_bool_arg (GObject *object, const gchar *argname)
{
GValue value;
g_value_init (&value, G_TYPE_BOOLEAN);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_boolean(&value);
}
......@@ -73,10 +75,11 @@ gst_util_get_bool_arg (GObject *object,gchar *argname)
* Returns: the property of the object
*/
glong
gst_util_get_long_arg (GObject *object,gchar *argname)
gst_util_get_long_arg (GObject *object, const gchar *argname)
{
GValue value;
g_value_init (&value, G_TYPE_LONG);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_long(&value);
}
......@@ -91,10 +94,11 @@ gst_util_get_long_arg (GObject *object,gchar *argname)
* Returns: the property of the object
*/
gfloat
gst_util_get_float_arg (GObject *object,gchar *argname)
gst_util_get_float_arg (GObject *object, const gchar *argname)
{
GValue value;
g_value_init (&value, G_TYPE_FLOAT);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_float(&value);
}
......@@ -109,10 +113,11 @@ gst_util_get_float_arg (GObject *object,gchar *argname)
* Returns: the property of the object
*/
gdouble
gst_util_get_double_arg (GObject *object,gchar *argname)
gst_util_get_double_arg (GObject *object, const gchar *argname)
{
GValue value;
g_value_init (&value, G_TYPE_DOUBLE);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_double(&value);
}
......@@ -126,11 +131,12 @@ gst_util_get_double_arg (GObject *object,gchar *argname)
*
* Returns: the property of the object
*/
gchar*
gst_util_get_string_arg (GObject *object,gchar *argname)
const gchar*
gst_util_get_string_arg (GObject *object, const gchar *argname)
{
GValue value;
g_value_init (&value, G_TYPE_STRING);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_string(&value);
}
......@@ -145,10 +151,11 @@ gst_util_get_string_arg (GObject *object,gchar *argname)
* Returns: the property of the object
*/
gpointer
gst_util_get_pointer_arg (GObject *object,gchar *argname)
gst_util_get_pointer_arg (GObject *object, const gchar *argname)
{
GValue value;
g_value_init (&value, G_TYPE_POINTER);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_pointer(&value);
}
......@@ -164,7 +171,7 @@ gst_util_get_pointer_arg (GObject *object,gchar *argname)
*/
/* COMMENTED OUT BECAUSE WE HAVE NO MORE gtk.h
GtkWidget*
gst_util_get_widget_property (GObject *object,gchar *argname)
gst_util_get_widget_property (GObject *object, const gchar *argname)
{
GtkArg arg;
......@@ -212,7 +219,7 @@ gst_util_dump_mem (guchar *mem, guint size)
* sets the argument with it.
*/
void
gst_util_set_object_arg (GObject *object, gchar *name, gchar *value)
gst_util_set_object_arg (GObject *object, const gchar *name, const gchar *value)
{
if (name && value) {
GParamSpec *paramspec;
......
......@@ -30,16 +30,16 @@
extern "C" {
#endif /* __cplusplus */
gint gst_util_get_int_arg (GObject *object, gchar *argname);
gboolean gst_util_get_bool_arg (GObject *object, gchar *argname);
glong gst_util_get_long_arg (GObject *object, gchar *argname);
gfloat gst_util_get_float_arg (GObject *object, gchar *argname);
gdouble gst_util_get_double_arg (GObject *object, gchar *argname);
gchar* gst_util_get_string_arg (GObject *object, gchar *argname);
gpointer gst_util_get_pointer_arg (GObject *object, gchar *argname);
gint gst_util_get_int_arg (GObject *object, const gchar *argname);
gboolean gst_util_get_bool_arg (GObject *object, const gchar *argname);
glong gst_util_get_long_arg (GObject *object, const gchar *argname);
gfloat gst_util_get_float_arg (GObject *object, const gchar *argname);
gdouble gst_util_get_double_arg (GObject *object, const gchar *argname);
const gchar* gst_util_get_string_arg (GObject *object, const gchar *argname);
gpointer gst_util_get_pointer_arg (GObject *object, const gchar *argname);
//GtkWidget* gst_util_get_widget_property (GObject *object, gchar *argname);
void gst_util_set_object_arg (GObject *object, gchar *name, gchar *value);
void gst_util_set_object_arg (GObject *object, const gchar *name, const gchar *value);
void gst_util_dump_mem (guchar *mem, guint size);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment