shadow: Rename to GtkCssShadowValue

I don't want to confuse css values with other stuff, so there.
This commit is contained in:
Benjamin Otte 2012-03-28 03:31:20 +02:00
parent da40ba431d
commit ec5c77a552
5 changed files with 60 additions and 64 deletions

View File

@ -421,7 +421,7 @@ shadow_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser,
GFile *base)
{
return _gtk_shadow_parse (parser);
return _gtk_css_shadow_value_parse (parser);
}
static GtkCssValue *
@ -429,7 +429,7 @@ shadow_value_compute (GtkCssStyleProperty *property,
GtkStyleContext *context,
GtkCssValue *specified)
{
return _gtk_shadow_resolve (specified, context);
return _gtk_css_shadow_value_compute (specified, context);
}
static GtkCssValue *
@ -1214,7 +1214,7 @@ _gtk_css_style_property_init_properties (void)
shadow_value_compute,
NULL,
NULL,
_gtk_shadow_new_none ());
_gtk_css_shadow_value_new_none ());
gtk_css_style_property_register ("icon-shadow",
G_TYPE_NONE,
@ -1224,7 +1224,7 @@ _gtk_css_style_property_init_properties (void)
shadow_value_compute,
NULL,
NULL,
_gtk_shadow_new_none ());
_gtk_css_shadow_value_new_none ());
gtk_css_style_property_register ("box-shadow",
G_TYPE_NONE,
@ -1234,7 +1234,7 @@ _gtk_css_style_property_init_properties (void)
shadow_value_compute,
NULL,
NULL,
_gtk_shadow_new_none ());
_gtk_css_shadow_value_new_none ());
gtk_css_style_property_register ("margin-top",
G_TYPE_INT,

View File

@ -105,7 +105,7 @@ shadow_element_new (gdouble hoffset,
}
/****************
* GtkShadow *
* GtkCssValue *
****************/
struct _GtkCssValue {
@ -118,7 +118,7 @@ gtk_css_value_shadow_free (GtkCssValue *shadow)
{
g_list_free_full (shadow->elements,
(GDestroyNotify) shadow_element_free);
g_slice_free (GtkShadow, shadow);
g_slice_free (GtkCssValue, shadow);
}
static gboolean
@ -164,26 +164,26 @@ static const GtkCssValueClass GTK_CSS_VALUE_SHADOW = {
static GtkCssValue none_singleton = { &GTK_CSS_VALUE_SHADOW, 1, NULL };
GtkShadow *
_gtk_shadow_new_none (void)
GtkCssValue *
_gtk_css_shadow_value_new_none (void)
{
return _gtk_css_value_ref (&none_singleton);
}
GtkShadow *
_gtk_shadow_parse (GtkCssParser *parser)
GtkCssValue *
_gtk_css_shadow_value_parse (GtkCssParser *parser)
{
gboolean have_inset, have_color, have_lengths;
gdouble hoffset, voffset, blur, spread;
GtkSymbolicColor *color;
GtkShadowElement *element;
GtkShadow *shadow;
GtkCssValue *shadow;
guint i;
if (_gtk_css_parser_try (parser, "none", TRUE))
return _gtk_shadow_new_none ();
return _gtk_css_shadow_value_new_none ();
shadow = _gtk_css_value_new (GtkShadow, &GTK_CSS_VALUE_SHADOW);
shadow = _gtk_css_value_new (GtkCssValue, &GTK_CSS_VALUE_SHADOW);
do
{
@ -257,16 +257,16 @@ _gtk_shadow_parse (GtkCssParser *parser)
return shadow;
}
GtkShadow *
_gtk_shadow_resolve (GtkShadow *shadow,
GtkStyleContext *context)
GtkCssValue *
_gtk_css_shadow_value_compute (GtkCssValue *shadow,
GtkStyleContext *context)
{
GtkShadow *resolved_shadow;
GtkCssValue *resolved_shadow;
GtkShadowElement *element, *resolved_element;
GdkRGBA color;
GList *l;
resolved_shadow = _gtk_css_value_new (GtkShadow, &GTK_CSS_VALUE_SHADOW);
resolved_shadow = _gtk_css_value_new (GtkCssValue, &GTK_CSS_VALUE_SHADOW);
for (l = shadow->elements; l != NULL; l = l->next)
{
@ -293,9 +293,9 @@ _gtk_shadow_resolve (GtkShadow *shadow,
}
void
_gtk_text_shadow_paint_layout (GtkShadow *shadow,
cairo_t *cr,
PangoLayout *layout)
_gtk_css_shadow_value_paint_layout (const GtkCssValue *shadow,
cairo_t *cr,
PangoLayout *layout)
{
GList *l;
GtkShadowElement *element;
@ -322,8 +322,8 @@ _gtk_text_shadow_paint_layout (GtkShadow *shadow,
}
void
_gtk_icon_shadow_paint (GtkShadow *shadow,
cairo_t *cr)
_gtk_css_shadow_value_paint_icon (const GtkCssValue *shadow,
cairo_t *cr)
{
GList *l;
GtkShadowElement *element;
@ -346,10 +346,10 @@ _gtk_icon_shadow_paint (GtkShadow *shadow,
}
void
_gtk_icon_shadow_paint_spinner (GtkShadow *shadow,
cairo_t *cr,
gdouble radius,
gdouble progress)
_gtk_css_shadow_value_paint_spinner (const GtkCssValue *shadow,
cairo_t *cr,
gdouble radius,
gdouble progress)
{
GtkShadowElement *element;
GList *l;
@ -370,9 +370,9 @@ _gtk_icon_shadow_paint_spinner (GtkShadow *shadow,
}
void
_gtk_box_shadow_render (GtkShadow *shadow,
cairo_t *cr,
const GtkRoundedBox *padding_box)
_gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
cairo_t *cr,
const GtkRoundedBox *padding_box)
{
GtkShadowElement *element;
GtkRoundedBox box;

View File

@ -20,40 +20,36 @@
#ifndef __GTK_SHADOW_H__
#define __GTK_SHADOW_H__
#include <glib-object.h>
#include <cairo.h>
#include <pango/pango.h>
#include "gtkstylecontext.h"
#include "gtksymboliccolor.h"
#include "gtkicontheme.h"
#include "gtktypes.h"
#include "gtkcssparserprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtkroundedboxprivate.h"
G_BEGIN_DECLS
typedef GtkCssValue GtkShadow;
GtkCssValue * _gtk_css_shadow_value_new_none (void);
GtkCssValue * _gtk_css_shadow_value_parse (GtkCssParser *parser);
GtkShadow *_gtk_shadow_new_none (void);
GtkShadow *_gtk_shadow_parse (GtkCssParser *parser);
GtkCssValue * _gtk_css_shadow_value_compute (GtkCssValue *shadow,
GtkStyleContext *context);
GtkShadow *_gtk_shadow_resolve (GtkShadow *shadow,
GtkStyleContext *context);
void _gtk_css_shadow_value_paint_layout (const GtkCssValue *shadow,
cairo_t *cr,
PangoLayout *layout);
void _gtk_text_shadow_paint_layout (GtkShadow *shadow,
cairo_t *cr,
PangoLayout *layout);
void _gtk_css_shadow_value_paint_icon (const GtkCssValue *shadow,
cairo_t *cr);
void _gtk_icon_shadow_paint (GtkShadow *shadow,
cairo_t *cr);
void _gtk_icon_shadow_paint_spinner (GtkShadow *shadow,
cairo_t *cr,
gdouble radius,
gdouble progress);
void _gtk_box_shadow_render (GtkShadow *shadow,
cairo_t *cr,
const GtkRoundedBox *padding_box);
void _gtk_css_shadow_value_paint_spinner (const GtkCssValue *shadow,
cairo_t *cr,
gdouble radius,
gdouble progress);
void _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
cairo_t *cr,
const GtkRoundedBox *padding_box);
G_END_DECLS

View File

@ -301,9 +301,9 @@ static void
_gtk_theming_background_apply_shadow (GtkThemingBackground *bg,
cairo_t *cr)
{
_gtk_box_shadow_render (_gtk_style_context_peek_property (bg->context, "box-shadow"),
cr,
&bg->padding_box);
_gtk_css_shadow_value_paint_box (_gtk_style_context_peek_property (bg->context, "box-shadow"),
cr,
&bg->padding_box);
}
static void

View File

@ -2100,7 +2100,7 @@ gtk_theming_engine_render_layout (GtkThemingEngine *engine,
PangoLayout *layout)
{
GdkRGBA fg_color;
GtkShadow *text_shadow = NULL;
GtkCssValue *text_shadow = NULL;
GtkStateFlags flags;
gdouble progress;
gboolean running;
@ -2136,7 +2136,7 @@ gtk_theming_engine_render_layout (GtkThemingEngine *engine,
prepare_context_for_layout (cr, x, y, layout);
_gtk_text_shadow_paint_layout (text_shadow, cr, layout);
_gtk_css_shadow_value_paint_layout (text_shadow, cr, layout);
gdk_cairo_set_source_rgba (cr, &fg_color);
pango_cairo_show_layout (cr, layout);
@ -2750,7 +2750,7 @@ render_spinner (GtkThemingEngine *engine,
gdouble height)
{
GtkStateFlags state;
GtkShadow *shadow;
GtkCssValue *shadow;
GdkRGBA color;
gdouble progress;
gdouble radius;
@ -2768,9 +2768,9 @@ render_spinner (GtkThemingEngine *engine,
cairo_save (cr);
cairo_translate (cr, x + width / 2, y + height / 2);
_gtk_icon_shadow_paint_spinner (shadow, cr,
radius,
progress);
_gtk_css_shadow_value_paint_spinner (shadow, cr,
radius,
progress);
_gtk_theming_engine_paint_spinner (cr,
radius,
@ -2941,7 +2941,7 @@ gtk_theming_engine_render_icon (GtkThemingEngine *engine,
gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
_gtk_icon_shadow_paint (_gtk_theming_engine_peek_property (engine, "icon-shadow"), cr);
_gtk_css_shadow_value_paint_icon (_gtk_theming_engine_peek_property (engine, "icon-shadow"), cr);
cairo_paint (cr);