void
gegl_operation_context_set_property (GeglOperationContext *context,
                                     const gchar          *property_name,
                                     const GValue         *value)
{
  GParamSpec *pspec;
  GValue     *storage;

  g_return_if_fail (context != NULL);

  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (context->operation)), property_name);

  if (!pspec)
    {
      g_warning ("%s: node %s has no pad|property named '%s'",
                 G_STRFUNC,
                 GEGL_OPERATION_GET_CLASS (context->operation)->name,
                 property_name);
    }

  /* if the value already exists in the context it will be reused */
  storage = gegl_operation_context_add_value (context, property_name, G_PARAM_SPEC_VALUE_TYPE(pspec));
  /* storage needs to have the correct type */
  g_value_copy (value, storage);
}
Пример #2
0
void
gegl_operation_context_take_object (GeglOperationContext *context,
                                    const gchar          *padname,
                                    GObject              *data)
{
  GValue *storage;

  g_return_if_fail (context != NULL);
  g_return_if_fail (!data || GEGL_IS_BUFFER (data));

  storage = gegl_operation_context_add_value (context, padname);
  g_value_take_object (storage, data);
}
Пример #3
0
void
gegl_operation_context_set_property (GeglOperationContext *context,
                                     const gchar          *property_name,
                                     const GValue         *value)
{
  GValue     *storage;

  g_return_if_fail (context != NULL);
  g_return_if_fail (G_VALUE_TYPE (value) == GEGL_TYPE_BUFFER);

  /* if the value already exists in the context it will be reused */
  storage = gegl_operation_context_add_value (context, property_name);

  g_value_copy (value, storage);
}