Commit 6dcef2f7 authored by Zach Goldberg's avatar Zach Goldberg Committed by Zeeshan Ali (Khattak)
Browse files

Add gupnp_service_action_get_gvalue for PyGI

Variant of gupnp_service_action_get_value that creates a new GValue and
returns that instead of taking an already initialized GValue and setting
it. This is mainly done to allow PyGI to deal with service actions. PyGI
maintainer refuses to handle reference type 'in' parameters correctly
because the only way to do that is 'inefficient'.

Co-author and reviewer: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
parent 7d5490af
......@@ -110,6 +110,7 @@ gupnp_service_action_get_locales
gupnp_service_action_get
gupnp_service_action_get_valist
gupnp_service_action_get_value
gupnp_service_action_get_gvalue
gupnp_service_action_set
gupnp_service_action_set_valist
gupnp_service_action_set_value
......
......@@ -391,7 +391,7 @@ gupnp_service_action_get_valist (GUPnPServiceAction *action,
}
/**
* gupnp_service_action_get_value
* gupnp_service_action_get_value: (skip)
* @action: A #GUPnPServiceAction
* @argument: The name of the argument to retrieve
* @value: The #GValue to store the value of the argument, initialized
......@@ -427,6 +427,35 @@ gupnp_service_action_get_value (GUPnPServiceAction *action,
action->name);
}
/**
* gupnp_service_action_get_gvalue:
* @action: A #GUPnPServiceAction
* @argument: The name of the argument to retrieve
* @type: The type of argument to retrieve
*
* Rename To: gupnp_service_action_get_value
* Retrieves the value of @argument into a GValue of type @type and returns it.
* The method exists only and only to satify PyGI, please use
* #gupnp_service_action_get_value and ignore this if possible.
*
* Return value: (transfer full): Value as #GValue associated with @action.
* #g_value_unset and #g_slice_free it after usage.
**/
GValue *
gupnp_service_action_get_gvalue (GUPnPServiceAction *action,
const char *argument,
GType type)
{
GValue *val;
val = g_slice_new0 (GValue);
g_value_init (val, type);
gupnp_service_action_get_value (action, argument, val);
return val;
}
/**
* gupnp_service_action_set
* @action: A #GUPnPServiceAction
......
......@@ -122,6 +122,11 @@ gupnp_service_action_get_value (GUPnPServiceAction *action,
const char *argument,
GValue *value);
GValue *
gupnp_service_action_get_gvalue (GUPnPServiceAction *action,
const char *argument,
GType type);
void
gupnp_service_action_set (GUPnPServiceAction *action,
...) G_GNUC_NULL_TERMINATED;
......
Supports Markdown
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