forked from AuroraMiddleware/gtk
shadow: Rename to GtkCssShadowValue
I don't want to confuse css values with other stuff, so there.
This commit is contained in:
parent
da40ba431d
commit
ec5c77a552
@ -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,
|
||||
|
@ -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 = { >K_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, >K_CSS_VALUE_SHADOW);
|
||||
shadow = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_SHADOW);
|
||||
|
||||
do
|
||||
{
|
||||
@ -257,16 +257,16 @@ _gtk_shadow_parse (GtkCssParser *parser)
|
||||
return shadow;
|
||||
}
|
||||
|
||||
GtkShadow *
|
||||
_gtk_shadow_resolve (GtkShadow *shadow,
|
||||
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, >K_CSS_VALUE_SHADOW);
|
||||
resolved_shadow = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_SHADOW);
|
||||
|
||||
for (l = shadow->elements; l != NULL; l = l->next)
|
||||
{
|
||||
@ -293,7 +293,7 @@ _gtk_shadow_resolve (GtkShadow *shadow,
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_text_shadow_paint_layout (GtkShadow *shadow,
|
||||
_gtk_css_shadow_value_paint_layout (const GtkCssValue *shadow,
|
||||
cairo_t *cr,
|
||||
PangoLayout *layout)
|
||||
{
|
||||
@ -322,7 +322,7 @@ _gtk_text_shadow_paint_layout (GtkShadow *shadow,
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_icon_shadow_paint (GtkShadow *shadow,
|
||||
_gtk_css_shadow_value_paint_icon (const GtkCssValue *shadow,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GList *l;
|
||||
@ -346,7 +346,7 @@ _gtk_icon_shadow_paint (GtkShadow *shadow,
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_icon_shadow_paint_spinner (GtkShadow *shadow,
|
||||
_gtk_css_shadow_value_paint_spinner (const GtkCssValue *shadow,
|
||||
cairo_t *cr,
|
||||
gdouble radius,
|
||||
gdouble progress)
|
||||
@ -370,7 +370,7 @@ _gtk_icon_shadow_paint_spinner (GtkShadow *shadow,
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_box_shadow_render (GtkShadow *shadow,
|
||||
_gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
|
||||
cairo_t *cr,
|
||||
const GtkRoundedBox *padding_box)
|
||||
{
|
||||
|
@ -20,38 +20,34 @@
|
||||
#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);
|
||||
|
||||
GtkShadow *_gtk_shadow_resolve (GtkShadow *shadow,
|
||||
GtkCssValue * _gtk_css_shadow_value_compute (GtkCssValue *shadow,
|
||||
GtkStyleContext *context);
|
||||
|
||||
void _gtk_text_shadow_paint_layout (GtkShadow *shadow,
|
||||
void _gtk_css_shadow_value_paint_layout (const GtkCssValue *shadow,
|
||||
cairo_t *cr,
|
||||
PangoLayout *layout);
|
||||
|
||||
void _gtk_icon_shadow_paint (GtkShadow *shadow,
|
||||
void _gtk_css_shadow_value_paint_icon (const GtkCssValue *shadow,
|
||||
cairo_t *cr);
|
||||
|
||||
void _gtk_icon_shadow_paint_spinner (GtkShadow *shadow,
|
||||
void _gtk_css_shadow_value_paint_spinner (const GtkCssValue *shadow,
|
||||
cairo_t *cr,
|
||||
gdouble radius,
|
||||
gdouble progress);
|
||||
void _gtk_box_shadow_render (GtkShadow *shadow,
|
||||
void _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
|
||||
cairo_t *cr,
|
||||
const GtkRoundedBox *padding_box);
|
||||
|
||||
|
@ -301,7 +301,7 @@ 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"),
|
||||
_gtk_css_shadow_value_paint_box (_gtk_style_context_peek_property (bg->context, "box-shadow"),
|
||||
cr,
|
||||
&bg->padding_box);
|
||||
}
|
||||
|
@ -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,7 +2768,7 @@ render_spinner (GtkThemingEngine *engine,
|
||||
cairo_save (cr);
|
||||
cairo_translate (cr, x + width / 2, y + height / 2);
|
||||
|
||||
_gtk_icon_shadow_paint_spinner (shadow, cr,
|
||||
_gtk_css_shadow_value_paint_spinner (shadow, cr,
|
||||
radius,
|
||||
progress);
|
||||
|
||||
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user