/* GTK - The GIMP Toolkit
* Copyright (C) 2011 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see .
*/
#include "config.h"
#include "gtkcssvalueprivate.h"
struct _GtkCssValue {
GTK_CSS_VALUE_BASE
};
G_DEFINE_BOXED_TYPE (GtkCssValue, _gtk_css_value, _gtk_css_value_ref, _gtk_css_value_unref)
GtkCssValue *
_gtk_css_value_alloc (const GtkCssValueClass *klass,
gsize size)
{
GtkCssValue *value;
value = g_slice_alloc0 (size);
value->class = klass;
value->ref_count = 1;
return value;
}
GtkCssValue *
_gtk_css_value_ref (GtkCssValue *value)
{
g_return_val_if_fail (value != NULL, NULL);
g_atomic_int_add (&value->ref_count, 1);
return value;
}
void
_gtk_css_value_unref (GtkCssValue *value)
{
if (value == NULL)
return;
if (!g_atomic_int_dec_and_test (&value->ref_count))
return;
value->class->free (value);
}
/**
* _gtk_css_value_compute:
* @value: the value to compute from
* @property_id: the ID of the property to compute
* @context: the context to use for resolving
* @dependencies: (out) (allow-none): Set to the dependencies of the
* computed values that indicate when this value needs to be
* recomputed and how.
*
* Converts the specified @value into the computed value for the CSS
* property given by @property_id using the information in @context.
* This step is explained in detail in
*