#include "gtkcsscolorvalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkhslaprivate.h"
#include "gtkprivate.h"
union
{
gchar *name;
+ GdkRGBA rgba;
struct
{
case GTK_CSS_PROPERTY_TEXT_SHADOW:
case GTK_CSS_PROPERTY_ICON_SHADOW:
case GTK_CSS_PROPERTY_BOX_SHADOW:
- return _gtk_css_rgba_value_new_transparent ();
+ return gtk_css_color_value_new_transparent ();
case GTK_CSS_PROPERTY_COLOR:
case GTK_CSS_PROPERTY_BACKGROUND_COLOR:
case GTK_CSS_PROPERTY_BORDER_TOP_COLOR:
if (property_id < GTK_CSS_PROPERTY_N_PROPERTIES)
g_warning ("No fallback color defined for property '%s'",
_gtk_style_property_get_name (GTK_STYLE_PROPERTY (_gtk_css_style_property_lookup_by_id (property_id))));
- return _gtk_css_rgba_value_new_transparent ();
+ return gtk_css_color_value_new_transparent ();
}
}
}
else if (value->type == COLOR_TYPE_LITERAL)
{
- resolved = _gtk_css_value_ref (value->last_value);
+ resolved = _gtk_css_value_ref (value);
}
else
{
switch (value1->type)
{
case COLOR_TYPE_LITERAL:
- return _gtk_css_value_equal (value1->last_value, value2->last_value);
+ return gdk_rgba_equal (&value1->sym_col.rgba, &value2->sym_col.rgba);
case COLOR_TYPE_NAME:
return g_str_equal (value1->sym_col.name, value2->sym_col.name);
case COLOR_TYPE_SHADE:
switch (value->type)
{
case COLOR_TYPE_LITERAL:
- _gtk_css_value_print (value->last_value, string);
+ {
+ char *s = gdk_rgba_to_string (&value->sym_col.rgba);
+ g_string_append (string, s);
+ g_free (s);
+ }
break;
case COLOR_TYPE_NAME:
g_string_append (string, "@");
_gdk_rgba_init_from_hsla (out, &hsla);
}
+static inline double
+transition (double start,
+ double end,
+ double progress)
+{
+ return start + (end - start) * progress;
+}
+
static void
apply_mix (const GdkRGBA *in1,
const GdkRGBA *in2,
GdkRGBA *out,
double factor)
{
- out->red = CLAMP (in1->red + ((in2->red - in1->red) * factor), 0, 1);
- out->green = CLAMP (in1->green + ((in2->green - in1->green) * factor), 0, 1);
- out->blue = CLAMP (in1->blue + ((in2->blue - in1->blue) * factor), 0, 1);
- out->alpha = CLAMP (in1->alpha + ((in2->alpha - in1->alpha) * factor), 0, 1);
+ out->alpha = CLAMP (transition (in1->alpha, in2->alpha, factor), 0, 1);
+
+ if (out->alpha <= 0.0)
+ {
+ out->red = out->green = out->blue = 0.0;
+ }
+ else
+ {
+ out->red = CLAMP (transition (in1->red * in1->alpha, in2->red * in2->alpha, factor), 0, 1) / out->alpha;
+ out->green = CLAMP (transition (in1->green * in1->alpha, in2->green * in2->alpha, factor), 0, 1) / out->alpha;
+ out->blue = CLAMP (transition (in1->blue * in1->alpha, in2->blue * in2->alpha, factor), 0, 1) / out->alpha;
+ }
}
GtkCssValue *
switch (color->type)
{
case COLOR_TYPE_LITERAL:
- return _gtk_css_value_ref (color->last_value);
+ return _gtk_css_value_ref (color);
case COLOR_TYPE_NAME:
{
GtkCssValue *named;
if (val == NULL)
return NULL;
- apply_shade (_gtk_css_rgba_value_get_rgba (val), &shade, color->sym_col.shade.factor);
+ apply_shade (gtk_css_color_value_get_rgba (val), &shade, color->sym_col.shade.factor);
_gtk_css_value_unref (val);
- value = _gtk_css_rgba_value_new_from_rgba (&shade);
+ value = _gtk_css_color_value_new_literal (&shade);
}
break;
if (val == NULL)
return NULL;
- alpha = *_gtk_css_rgba_value_get_rgba (val);
+ alpha = *gtk_css_color_value_get_rgba (val);
apply_alpha (&alpha, &alpha, color->sym_col.alpha.factor);
_gtk_css_value_unref (val);
- value = _gtk_css_rgba_value_new_from_rgba (&alpha);
+ value = _gtk_css_color_value_new_literal (&alpha);
}
break;
val = _gtk_css_color_value_resolve (color->sym_col.mix.color1, provider, current, cycle_list);
if (val == NULL)
return NULL;
- color1 = *_gtk_css_rgba_value_get_rgba (val);
+ color1 = *gtk_css_color_value_get_rgba (val);
_gtk_css_value_unref (val);
val = _gtk_css_color_value_resolve (color->sym_col.mix.color2, provider, current, cycle_list);
if (val == NULL)
return NULL;
- color2 = *_gtk_css_rgba_value_get_rgba (val);
+ color2 = *gtk_css_color_value_get_rgba (val);
_gtk_css_value_unref (val);
apply_mix (&color1, &color2, &res, color->sym_col.mix.factor);
- value =_gtk_css_rgba_value_new_from_rgba (&res);
+ value = _gtk_css_color_value_new_literal (&res);
}
break;
return value;
}
+static GtkCssValue transparent_black_singleton = { >K_CSS_VALUE_COLOR, 1, COLOR_TYPE_LITERAL, NULL,
+ .sym_col.rgba = {0, 0, 0, 0} };
+static GtkCssValue white_singleton = { >K_CSS_VALUE_COLOR, 1, COLOR_TYPE_LITERAL, NULL,
+ .sym_col.rgba = {1, 1, 1, 1} };
+
+
+GtkCssValue *
+gtk_css_color_value_new_transparent (void)
+{
+ return _gtk_css_value_ref (&transparent_black_singleton);
+}
+
+GtkCssValue *
+gtk_css_color_value_new_white (void)
+{
+ return _gtk_css_value_ref (&white_singleton);
+}
+
GtkCssValue *
_gtk_css_color_value_new_literal (const GdkRGBA *color)
{
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
value->type = COLOR_TYPE_LITERAL;
- value->last_value = _gtk_css_rgba_value_new_from_rgba (color);
+ value->sym_col.rgba = *color;
return value;
}
if (color->type == COLOR_TYPE_LITERAL)
{
- GdkRGBA c = *_gtk_css_rgba_value_get_rgba (color->last_value);
+ GdkRGBA c;
- apply_shade (&c, &c, factor);
+ apply_shade (&color->sym_col.rgba, &c, factor);
return _gtk_css_color_value_new_literal (&c);
}
if (color->type == COLOR_TYPE_LITERAL)
{
- GdkRGBA c = *_gtk_css_rgba_value_get_rgba (color->last_value);
+ GdkRGBA c;
- apply_alpha (&c, &c, factor);
+ apply_alpha (&color->sym_col.rgba, &c, factor);
return _gtk_css_color_value_new_literal (&c);
}
if (color1->type == COLOR_TYPE_LITERAL &&
color2->type == COLOR_TYPE_LITERAL)
{
- GdkRGBA c1 = *_gtk_css_rgba_value_get_rgba (color1->last_value);
- GdkRGBA c2 = *_gtk_css_rgba_value_get_rgba (color2->last_value);
GdkRGBA result;
- apply_mix (&c1, &c2, &result, factor);
+ apply_mix (&color1->sym_col.rgba, &color2->sym_col.rgba, &result, factor);
return _gtk_css_color_value_new_literal (&result);
return NULL;
}
+const GdkRGBA *
+gtk_css_color_value_get_rgba (const GtkCssValue *color)
+{
+ g_assert (color->class == >K_CSS_VALUE_COLOR);
+ g_assert (color->type == COLOR_TYPE_LITERAL);
+
+ return &color->sym_col.rgba;
+}
G_BEGIN_DECLS
+GtkCssValue * gtk_css_color_value_new_transparent (void);
+GtkCssValue * gtk_css_color_value_new_white (void);
GtkCssValue * _gtk_css_color_value_new_literal (const GdkRGBA *color);
GtkCssValue * _gtk_css_color_value_new_name (const gchar *name);
GtkCssValue * _gtk_css_color_value_new_shade (GtkCssValue *color,
GtkStyleProvider *provider,
GtkCssValue *current,
GSList *cycle_list);
+const GdkRGBA * gtk_css_color_value_get_rgba (const GtkCssValue *color);
G_END_DECLS
#include "gtkcssimagefallbackprivate.h"
#include "gtkcsscolorvalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkstyleproviderprivate.h"
const GdkRGBA *color;
if (fallback->color)
- color = _gtk_css_rgba_value_get_rgba (fallback->color);
+ color = gtk_css_color_value_get_rgba (fallback->color);
else
color = &red;
#include <math.h>
#include "gtkcssiconthemevalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
#include "gtksettingsprivate.h"
#include "gtksnapshot.h"
#include "gtkstyleproviderprivate.h"
#include "gtkcsscolorvalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcssprovider.h"
G_DEFINE_TYPE (GtkCssImageLinear, _gtk_css_image_linear, GTK_TYPE_CSS_IMAGE)
linear->stops->len - 1);
gtk_snapshot_append_color (snapshot,
- _gtk_css_rgba_value_get_rgba (stop->color),
+ gtk_css_color_value_get_rgba (stop->color),
&GRAPHENE_RECT_INIT (0, 0, width, height));
return;
}
offset += step;
stops[last].offset = (offset - start) / (end - start);
- stops[last].color = *_gtk_css_rgba_value_get_rgba (stop->color);
+ stops[last].color = *gtk_css_color_value_get_rgba (stop->color);
}
offset = pos;
#include "gtkcsscolorvalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcsspositionvalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcssprovider.h"
G_DEFINE_TYPE (GtkCssImageRadial, _gtk_css_image_radial, GTK_TYPE_CSS_IMAGE)
stop = &g_array_index (radial->stops, GtkCssImageRadialColorStop, last);
- rgba = _gtk_css_rgba_value_get_rgba (stop->color);
+ rgba = gtk_css_color_value_get_rgba (stop->color);
offset += step;
cairo_pattern_add_color_stop_rgba (pattern,
#include "gtkcssimagerecolorprivate.h"
#include "gtkcssimageprivate.h"
#include "gtkcsspalettevalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkiconthemeprivate.h"
#include "gdkpixbufutilsprivate.h"
const GdkRGBA *lookup;
color = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR);
- *color_out = *_gtk_css_rgba_value_get_rgba (color);
+ *color_out = *gtk_css_color_value_get_rgba (color);
lookup = gtk_css_palette_value_get_color (palette, "success");
if (lookup)
#include "gtkcssiconthemevalueprivate.h"
#include "gtkcsscolorvalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkprivate.h"
struct _GtkCssValue {
for (i = 0; i < value->n_colors; i ++)
{
if (strcmp (value->color_names[i], name) == 0)
- return _gtk_css_rgba_value_get_rgba (value->color_values[i]);
+ return gtk_css_color_value_get_rgba (value->color_values[i]);
}
return NULL;
+++ /dev/null
-/* 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 <http://www.gnu.org/licenses/>.
- */
-
-#include "config.h"
-
-#include "gtkcssrgbavalueprivate.h"
-
-#include "gtkcssstylepropertyprivate.h"
-#include "gtkstylecontextprivate.h"
-
-struct _GtkCssValue {
- GTK_CSS_VALUE_BASE
- GdkRGBA rgba;
-};
-
-static void
-gtk_css_value_rgba_free (GtkCssValue *value)
-{
- g_slice_free (GtkCssValue, value);
-}
-
-static GtkCssValue *
-gtk_css_value_rgba_compute (GtkCssValue *value,
- guint property_id,
- GtkStyleProvider *provider,
- GtkCssStyle *style,
- GtkCssStyle *parent_style)
-{
- return _gtk_css_value_ref (value);
-}
-
-static gboolean
-gtk_css_value_rgba_equal (const GtkCssValue *rgba1,
- const GtkCssValue *rgba2)
-{
- return gdk_rgba_equal (&rgba1->rgba, &rgba2->rgba);
-}
-
-static inline double
-transition (double start,
- double end,
- double progress)
-{
- return start + (end - start) * progress;
-}
-
-static GtkCssValue *
-gtk_css_value_rgba_transition (GtkCssValue *start,
- GtkCssValue *end,
- guint property_id,
- double progress)
-{
- GdkRGBA result;
-
- progress = CLAMP (progress, 0, 1);
- result.alpha = transition (start->rgba.alpha, end->rgba.alpha, progress);
- if (result.alpha <= 0.0)
- {
- result.red = result.green = result.blue = 0.0;
- }
- else
- {
- result.red = transition (start->rgba.red * start->rgba.alpha,
- end->rgba.red * end->rgba.alpha,
- progress) / result.alpha;
- result.green = transition (start->rgba.green * start->rgba.alpha,
- end->rgba.green * end->rgba.alpha,
- progress) / result.alpha;
- result.blue = transition (start->rgba.blue * start->rgba.alpha,
- end->rgba.blue * end->rgba.alpha,
- progress) / result.alpha;
- }
-
- return _gtk_css_rgba_value_new_from_rgba (&result);
-}
-
-static void
-gtk_css_value_rgba_print (const GtkCssValue *rgba,
- GString *string)
-{
- char *s = gdk_rgba_to_string (&rgba->rgba);
- g_string_append (string, s);
- g_free (s);
-}
-
-static const GtkCssValueClass GTK_CSS_VALUE_RGBA = {
- "GtkCssRgbaValue",
- gtk_css_value_rgba_free,
- gtk_css_value_rgba_compute,
- gtk_css_value_rgba_equal,
- gtk_css_value_rgba_transition,
- NULL,
- NULL,
- gtk_css_value_rgba_print
-};
-
-static GtkCssValue transparent_black_singleton = { >K_CSS_VALUE_RGBA, 1, { 0, 0, 0, 0 }};
-static GtkCssValue transparent_white_singleton = { >K_CSS_VALUE_RGBA, 1, { 1, 1, 1, 0 }};
-static GtkCssValue opaque_white_singleton = { >K_CSS_VALUE_RGBA, 1, { 1, 1, 1, 1 }};
-
-GtkCssValue *
-_gtk_css_rgba_value_new_from_rgba (const GdkRGBA *rgba)
-{
- GtkCssValue *value;
-
- g_return_val_if_fail (rgba != NULL, NULL);
-
- if (gdk_rgba_is_clear (rgba))
- {
- if (rgba->red == 1 &&
- rgba->green == 1 &&
- rgba->blue == 1)
- return _gtk_css_value_ref (&transparent_white_singleton);
-
- if (rgba->red == 0 &&
- rgba->green == 0 &&
- rgba->blue == 0)
- return _gtk_css_value_ref (&transparent_black_singleton);
- }
- else if (gdk_rgba_is_opaque (rgba))
- {
- if (rgba->red == 1 &&
- rgba->green == 1 &&
- rgba->blue == 1)
- return _gtk_css_value_ref (&opaque_white_singleton);
- }
-
- value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_RGBA);
- value->rgba = *rgba;
-
- return value;
-}
-
-GtkCssValue *
-_gtk_css_rgba_value_new_transparent (void)
-{
- return _gtk_css_value_ref (&transparent_black_singleton);
-}
-
-GtkCssValue *
-_gtk_css_rgba_value_new_white (void)
-{
- return _gtk_css_value_ref (&opaque_white_singleton);
-}
-
-const GdkRGBA *
-_gtk_css_rgba_value_get_rgba (const GtkCssValue *rgba)
-{
- g_return_val_if_fail (rgba->class == >K_CSS_VALUE_RGBA, NULL);
-
- return &rgba->rgba;
-}
+++ /dev/null
-/*
- * Copyright © 2012 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.1 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 <http://www.gnu.org/licenses/>.
- *
- * Authors: Alexander Larsson <alexl@gnome.org>
- */
-
-#ifndef __GTK_CSS_RGBA_VALUE_PRIVATE_H__
-#define __GTK_CSS_RGBA_VALUE_PRIVATE_H__
-
-#include "gtkcssparserprivate.h"
-#include "gtkcsstypesprivate.h"
-#include "gtkcssvalueprivate.h"
-
-G_BEGIN_DECLS
-
-GtkCssValue * _gtk_css_rgba_value_new_from_rgba (const GdkRGBA *rgba);
-GtkCssValue * _gtk_css_rgba_value_new_transparent (void);
-GtkCssValue * _gtk_css_rgba_value_new_white (void);
-
-const GdkRGBA * _gtk_css_rgba_value_get_rgba (const GtkCssValue *rgba) G_GNUC_PURE;
-
-
-G_END_DECLS
-
-#endif /* __GTK_CSS_RGBA_VALUE_PRIVATE_H__ */
#include "gtkcsscolorvalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtksnapshotprivate.h"
#include "gtkstylecontextprivate.h"
#include "gtkpango.h"
_gtk_css_number_value_new (0, GTK_CSS_PX),
_gtk_css_number_value_new (0, GTK_CSS_PX),
target->inset,
- _gtk_css_rgba_value_new_transparent ());
+ gtk_css_color_value_new_transparent ());
}
enum {
gtk_css_shadow_value_get_shadow (const GtkCssValue *value,
GskShadow *shadow)
{
- shadow->color = *_gtk_css_rgba_value_get_rgba (value->color);
+ shadow->color = *gtk_css_color_value_get_rgba (value->color);
shadow->dx = _gtk_css_number_value_get (value->hoffset, 0);
shadow->dy = _gtk_css_number_value_get (value->voffset, 0);
shadow->radius = _gtk_css_number_value_get (value->radius, 0);
g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW);
/* We don't need to draw invisible shadows */
- if (gdk_rgba_is_clear (_gtk_css_rgba_value_get_rgba (shadow->color)))
+ if (gdk_rgba_is_clear (gtk_css_color_value_get_rgba (shadow->color)))
return;
gtk_snapshot_append_outset_shadow (snapshot,
border_box,
- _gtk_css_rgba_value_get_rgba (shadow->color),
+ gtk_css_color_value_get_rgba (shadow->color),
_gtk_css_number_value_get (shadow->hoffset, 0),
_gtk_css_number_value_get (shadow->voffset, 0),
_gtk_css_number_value_get (shadow->spread, 0),
g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW);
/* We don't need to draw invisible shadows */
- if (gdk_rgba_is_clear (_gtk_css_rgba_value_get_rgba (shadow->color)))
+ if (gdk_rgba_is_clear (gtk_css_color_value_get_rgba (shadow->color)))
return;
dx = _gtk_css_number_value_get (shadow->hoffset, 0);
dy = _gtk_css_number_value_get (shadow->voffset, 0);
spread = _gtk_css_number_value_get (shadow->spread, 0);
radius = _gtk_css_number_value_get (shadow->radius, 0);
- color = _gtk_css_rgba_value_get_rgba (shadow->color);
+ color = gtk_css_color_value_get_rgba (shadow->color);
/* These are trivial to do with a color node */
if (spread == 0 && radius == 0 &&
gboolean
gtk_css_shadow_value_is_clear (const GtkCssValue *shadow)
{
- return gdk_rgba_is_clear (_gtk_css_rgba_value_get_rgba (shadow->color));
+ return gdk_rgba_is_clear (gtk_css_color_value_get_rgba (shadow->color));
}
#include "gtkcssinheritvalueprivate.h"
#include "gtkcssinitialvalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtkcssstringvalueprivate.h"
#include "gtkcssfontfeaturesvalueprivate.h"
/* text-decoration */
decoration_line = _gtk_css_text_decoration_line_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_TEXT_DECORATION_LINE));
decoration_style = _gtk_css_text_decoration_style_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_TEXT_DECORATION_STYLE));
- color = _gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR));
- decoration_color = _gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_TEXT_DECORATION_COLOR));
+ color = gtk_css_color_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR));
+ decoration_color = gtk_css_color_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_TEXT_DECORATION_COLOR));
switch (decoration_line)
{
#include "gtkcsspalettevalueprivate.h"
#include "gtkcsspositionvalueprivate.h"
#include "gtkcssrepeatvalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
#include "gtkcssshadowsvalueprivate.h"
#include "gtkcssstringvalueprivate.h"
#include "gtkcsstransformvalueprivate.h"
GValue *value)
{
g_value_init (value, GDK_TYPE_RGBA);
- g_value_set_boxed (value, _gtk_css_rgba_value_get_rgba (css_value));
+ g_value_set_boxed (value, gtk_css_color_value_get_rgba (css_value));
}
static GtkCssValue *
GTK_CSS_AFFECTS_CONTENT | GTK_CSS_AFFECTS_SYMBOLIC_ICON,
color_parse,
color_query,
- _gtk_css_rgba_value_new_white ());
+ gtk_css_color_value_new_white ());
gtk_css_style_property_register ("-gtk-dpi",
GTK_CSS_PROPERTY_DPI,
G_TYPE_NONE,
GTK_CSS_AFFECTS_BACKGROUND,
color_parse,
color_query,
- _gtk_css_rgba_value_new_transparent ());
+ gtk_css_color_value_new_transparent ());
gtk_css_style_property_register ("font-family",
GTK_CSS_PROPERTY_FONT_FAMILY,
#include "gtkiconthemeprivate.h"
#include "gtkcsspalettevalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkdebug.h"
#include "gtkiconcacheprivate.h"
#include "gtkintl.h"
color = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR);
palette = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_PALETTE);
- *color_out = *_gtk_css_rgba_value_get_rgba (color);
+ *color_out = *gtk_css_color_value_get_rgba (color);
lookup = gtk_css_palette_value_get_color (palette, "success");
if (lookup)
#include "gtkcsscornervalueprivate.h"
#include "gtkcssimagevalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcssshadowsvalueprivate.h"
#include "gtkcsstransformvalueprivate.h"
#include "gtkhslaprivate.h"
cairo_save (cr);
- color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_COLOR));
+ color = gtk_css_color_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_COLOR));
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
cairo_set_line_width (cr, 1);
#include "gtkcssshadowsvalueprivate.h"
#include "gtkcsspositionvalueprivate.h"
#include "gtkcssrepeatvalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcssstyleprivate.h"
#include "gtkcsstypesprivate.h"
GskBlendMode *blend_mode_values;
background_image = gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BACKGROUND_IMAGE);
- bg_color = _gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
+ bg_color = gtk_css_color_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
box_shadow = gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BOX_SHADOW);
/* This is the common default case of no background */
#include "gtkcssimagevalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssrepeatvalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcssstyleprivate.h"
#include "gtkhslaprivate.h"
#include "gtkroundedboxprivate.h"
gtk_css_boxes_get_padding_rect (boxes)))
return;
- colors[0] = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BORDER_TOP_COLOR));
- colors[1] = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR));
- colors[2] = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR));
- colors[3] = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR));
+ colors[0] = *gtk_css_color_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BORDER_TOP_COLOR));
+ colors[1] = *gtk_css_color_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR));
+ colors[2] = *gtk_css_color_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR));
+ colors[3] = *gtk_css_color_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR));
alpha_test_vector = graphene_simd4f_init (colors[0].alpha, colors[1].alpha, colors[2].alpha, colors[3].alpha);
if (graphene_simd4f_is_zero4 (alpha_test_vector))
border_style[1] = border_style[2] = border_style[3] = border_style[0];
border_width[0] = _gtk_css_number_value_get (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_OUTLINE_WIDTH), 100);
border_width[3] = border_width[2] = border_width[1] = border_width[0];
- colors[0] = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_OUTLINE_COLOR));
+ colors[0] = *gtk_css_color_value_get_rgba (gtk_css_style_get_value (boxes->style, GTK_CSS_PROPERTY_OUTLINE_COLOR));
colors[3] = colors[2] = colors[1] = colors[0];
snapshot_border (snapshot,
#include "gtksnapshot.h"
#include "gtksnapshotprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcssshadowsvalueprivate.h"
#include "gtkdebug.h"
#include "gtkrenderbackgroundprivate.h"
gtk_snapshot_save (snapshot);
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
- fg_color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_COLOR));
+ fg_color = gtk_css_color_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_COLOR));
shadows_value = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_TEXT_SHADOW);
has_shadow = gtk_css_shadows_value_push_snapshot (shadows_value, snapshot);
#include "gtkcssnodeprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcsspathnodeprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcsscolorvalueprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkcsstransientnodeprivate.h"
if (val == NULL)
return FALSE;
- *result = *_gtk_css_rgba_value_get_rgba (val);
+ *result = *gtk_css_color_value_get_rgba (val);
_gtk_css_value_unref (val);
return TRUE;
}
#include "gtkcellrenderer.h"
#include "gtkcontainer.h"
#include "gtkcssnumbervalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkdragdest.h"
#include "gtkdragsource.h"
const GdkRGBA *grid_line_color;
context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
- grid_line_color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context,
+ grid_line_color = gtk_css_color_value_get_rgba (_gtk_style_context_peek_property (context,
GTK_CSS_PROPERTY_BORDER_TOP_COLOR));
if (!gdk_rgba_equal (grid_line_color, &tree_view->grid_line_color) ||
const GdkRGBA *tree_line_color;
context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
- tree_line_color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context,
+ tree_line_color = gtk_css_color_value_get_rgba (_gtk_style_context_peek_property (context,
GTK_CSS_PROPERTY_BORDER_LEFT_COLOR));
if (!gdk_rgba_equal (tree_line_color, &tree_view->tree_line_color) ||
#include "gtkcontainerprivate.h"
#include "gtkcsscornervalueprivate.h"
#include "gtkcssiconthemevalueprivate.h"
-#include "gtkcssrgbavalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcssshadowsvalueprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkdragdest.h"
context = gtk_widget_get_style_context (widget);
- is_opaque = gdk_rgba_is_opaque (_gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BACKGROUND_COLOR)));
+ is_opaque = gdk_rgba_is_opaque (gtk_css_color_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BACKGROUND_COLOR)));
if (gtk_widget_get_opacity (widget) < 1.0)
is_opaque = FALSE;
'gtkcsspathnode.c',
'gtkcsspositionvalue.c',
'gtkcssrepeatvalue.c',
- 'gtkcssrgbavalue.c',
'gtkcssselector.c',
'gtkcssshadowsvalue.c',
'gtkcssshadowvalue.c',