css: Merge GtkStyleProviderPrivate into GtkStyleProvider

This is just lots of renaming.

The interface remains private, so the public API does not change, apart
from removing the definition of the Interface object to avoid
subclassing.
This commit is contained in:
Benjamin Otte 2017-10-31 04:31:46 +01:00
parent c8986e66ce
commit 83fb7a649f
62 changed files with 487 additions and 574 deletions

View File

@ -328,7 +328,7 @@ gtk_css_animated_style_create_css_animations (GSList *animation
GtkCssStyle *base_style,
GtkCssStyle *parent_style,
gint64 timestamp,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *source)
{
GtkCssValue *durations, *delays, *timing_functions, *animation_names;
@ -369,7 +369,7 @@ gtk_css_animated_style_create_css_animations (GSList *animation
}
else
{
keyframes = _gtk_style_provider_private_get_keyframes (provider, name);
keyframes = gtk_style_provider_get_keyframes (provider, name);
if (keyframes == NULL)
continue;
@ -413,7 +413,7 @@ GtkCssStyle *
gtk_css_animated_style_new (GtkCssStyle *base_style,
GtkCssStyle *parent_style,
gint64 timestamp,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *previous_style)
{
GtkCssAnimatedStyle *result;

View File

@ -55,7 +55,7 @@ GType gtk_css_animated_style_get_type (void) G_GNUC_CO
GtkCssStyle * gtk_css_animated_style_new (GtkCssStyle *base_style,
GtkCssStyle *parent_style,
gint64 timestamp,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *previous_style);
GtkCssStyle * gtk_css_animated_style_new_advance (GtkCssAnimatedStyle *source,
GtkCssStyle *base,

View File

@ -45,7 +45,7 @@ gtk_css_value_array_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_array_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -43,7 +43,7 @@ gtk_css_value_bg_size_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_bg_size_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -44,7 +44,7 @@ gtk_css_value_border_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_border_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -100,7 +100,7 @@ gtk_css_calc_array_add (GPtrArray *array, GtkCssValue *value)
static GtkCssValue *
gtk_css_value_calc_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -104,7 +104,7 @@ gtk_css_value_color_free (GtkCssValue *color)
static GtkCssValue *
gtk_css_value_color_get_fallback (guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -144,7 +144,7 @@ gtk_css_value_color_get_fallback (guint property_id,
GtkCssValue *
_gtk_css_color_value_resolve (GtkCssValue *color,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssValue *current,
GSList *cycle_list)
{
@ -167,7 +167,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
if (g_slist_find (cycle_list, color))
return NULL;
named = _gtk_style_provider_private_get_color (provider, color->sym_col.name);
named = gtk_style_provider_get_color (provider, color->sym_col.name);
if (named == NULL)
return NULL;
@ -291,7 +291,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
static GtkCssValue *
gtk_css_value_color_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -44,7 +44,7 @@ GtkCssValue * _gtk_css_color_value_new_current_color (void);
GtkCssValue * _gtk_css_color_value_parse (GtkCssParser *parser);
GtkCssValue * _gtk_css_color_value_resolve (GtkCssValue *color,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssValue *current,
GSList *cycle_list);

View File

@ -39,7 +39,7 @@ gtk_css_value_corner_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_corner_compute (GtkCssValue *corner,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -38,7 +38,7 @@ gtk_css_value_dimension_free (GtkCssValue *value)
static double
get_base_font_size_px (guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -62,7 +62,7 @@ get_dpi (GtkCssStyle *style)
static GtkCssValue *
gtk_css_value_dimension_compute (GtkCssValue *number,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -52,7 +52,7 @@ gtk_css_value_ease_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_ease_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -45,7 +45,7 @@ gtk_css_value_enum_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_enum_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -205,13 +205,13 @@ get_dpi (GtkCssStyle *style)
#define DEFAULT_FONT_SIZE_PT 10
double
gtk_css_font_size_get_default_px (GtkStyleProviderPrivate *provider,
gtk_css_font_size_get_default_px (GtkStyleProvider *provider,
GtkCssStyle *style)
{
GtkSettings *settings;
int font_size;
settings = _gtk_style_provider_private_get_settings (provider);
settings = gtk_style_provider_get_settings (provider);
if (settings == NULL)
return DEFAULT_FONT_SIZE_PT * get_dpi (style) / 72.0;
@ -227,7 +227,7 @@ gtk_css_font_size_get_default_px (GtkStyleProviderPrivate *provider,
static GtkCssValue *
gtk_css_value_font_size_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -388,7 +388,7 @@ _gtk_css_font_style_value_get (const GtkCssValue *value)
static GtkCssValue *
gtk_css_value_font_weight_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -38,7 +38,7 @@ GtkBorderStyle _gtk_css_border_style_value_get (const GtkCssValue *value)
GtkCssValue * _gtk_css_font_size_value_new (GtkCssFontSize size);
GtkCssValue * _gtk_css_font_size_value_try_parse (GtkCssParser *parser);
GtkCssFontSize _gtk_css_font_size_value_get (const GtkCssValue *value);
double gtk_css_font_size_get_default_px (GtkStyleProviderPrivate *provider,
double gtk_css_font_size_get_default_px (GtkStyleProvider *provider,
GtkCssStyle *style);
GtkCssValue * _gtk_css_font_style_value_new (PangoStyle style);

View File

@ -303,7 +303,7 @@ static gboolean
gtk_css_filter_compute (GtkCssFilter *dest,
GtkCssFilter *src,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -358,7 +358,7 @@ gtk_css_filter_compute (GtkCssFilter *dest,
static GtkCssValue *
gtk_css_value_filter_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -72,7 +72,7 @@ gtk_css_value_icon_theme_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_icon_theme_compute (GtkCssValue *icon_theme,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -81,7 +81,7 @@ gtk_css_value_icon_theme_compute (GtkCssValue *icon_theme,
if (icon_theme->icontheme)
icontheme = icon_theme->icontheme;
else
icontheme = gtk_icon_theme_get_for_display (_gtk_settings_get_display (_gtk_style_provider_private_get_settings (provider)));
icontheme = gtk_icon_theme_get_for_display (_gtk_settings_get_display (gtk_style_provider_get_settings (provider)));
return gtk_css_icon_theme_value_new (icontheme);
}

View File

@ -66,7 +66,7 @@ gtk_css_image_real_get_aspect_ratio (GtkCssImage *image)
static GtkCssImage *
gtk_css_image_real_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -186,7 +186,7 @@ _gtk_css_image_get_aspect_ratio (GtkCssImage *image)
GtkCssImage *
_gtk_css_image_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -476,7 +476,7 @@ gtk_css_image_builtin_print (GtkCssImage *image,
static GtkCssImage *
gtk_css_image_builtin_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -195,7 +195,7 @@ gtk_css_image_cross_fade_print (GtkCssImage *image,
static GtkCssImage *
gtk_css_image_cross_fade_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -133,7 +133,7 @@ gtk_css_image_fallback_dispose (GObject *object)
static GtkCssImage *
gtk_css_image_fallback_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -154,7 +154,7 @@ gtk_css_image_icon_theme_print (GtkCssImage *image,
static GtkCssImage *
gtk_css_image_icon_theme_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -164,7 +164,7 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
copy = g_object_new (GTK_TYPE_CSS_IMAGE_ICON_THEME, NULL);
copy->name = g_strdup (icon_theme->name);
copy->icon_theme = gtk_css_icon_theme_value_get_icon_theme (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_THEME));
copy->scale = _gtk_style_provider_private_get_scale (provider);
copy->scale = gtk_style_provider_get_scale (provider);
gtk_icon_theme_lookup_symbolic_colors (style, &copy->color, &copy->success, &copy->warning, &copy->error);
return GTK_CSS_IMAGE (copy);

View File

@ -459,7 +459,7 @@ gtk_css_image_linear_print (GtkCssImage *image,
static GtkCssImage *
gtk_css_image_linear_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -58,7 +58,7 @@ struct _GtkCssImageClass
/* create "computed value" in CSS terms, returns a new reference */
GtkCssImage *(* compute) (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style);
/* compare two images for equality */
@ -98,7 +98,7 @@ double _gtk_css_image_get_aspect_ratio (GtkCssImage *
GtkCssImage * _gtk_css_image_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style);
gboolean _gtk_css_image_equal (GtkCssImage *image1,

View File

@ -459,7 +459,7 @@ gtk_css_image_radial_print (GtkCssImage *image,
static GtkCssImage *
gtk_css_image_radial_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -146,7 +146,7 @@ gtk_css_image_recolor_load (GtkCssImageRecolor *recolor,
static GtkCssImage *
gtk_css_image_recolor_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -156,7 +156,7 @@ gtk_css_image_recolor_compute (GtkCssImage *image,
int scale;
GError *error = NULL;
scale = _gtk_style_provider_private_get_scale (provider);
scale = gtk_style_provider_get_scale (provider);
if (recolor->palette)
palette = _gtk_css_value_compute (recolor->palette, property_id, provider, style, parent_style);
@ -168,7 +168,7 @@ gtk_css_image_recolor_compute (GtkCssImage *image,
if (error)
{
GtkCssSection *section = gtk_css_style_get_section (style, property_id);
_gtk_style_provider_private_emit_error (provider, section, error);
gtk_style_provider_emit_error (provider, section, error);
g_error_free (error);
}

View File

@ -95,14 +95,14 @@ gtk_css_image_scaled_dispose (GObject *object)
static GtkCssImage *
gtk_css_image_scaled_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
GtkCssImageScaled *scaled = GTK_CSS_IMAGE_SCALED (image);
int scale;
scale = _gtk_style_provider_private_get_scale (provider);
scale = gtk_style_provider_get_scale (provider);
scale = MAX(MIN (scale, scaled->n_images), 1);
return _gtk_css_image_compute (scaled->images[scale - 1],

View File

@ -127,7 +127,7 @@ gtk_css_image_url_snapshot (GtkCssImage *image,
static GtkCssImage *
gtk_css_image_url_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -139,7 +139,7 @@ gtk_css_image_url_compute (GtkCssImage *image,
if (error)
{
GtkCssSection *section = gtk_css_style_get_section (style, property_id);
_gtk_style_provider_private_emit_error (provider, section, error);
gtk_style_provider_emit_error (provider, section, error);
g_error_free (error);
}

View File

@ -36,7 +36,7 @@ gtk_css_value_image_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_image_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -36,7 +36,7 @@ gtk_css_value_inherit_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_inherit_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -40,7 +40,7 @@ gtk_css_value_initial_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_initial_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -49,7 +49,7 @@ gtk_css_value_initial_compute (GtkCssValue *value,
switch (property_id)
{
case GTK_CSS_PROPERTY_DPI:
settings = _gtk_style_provider_private_get_settings (provider);
settings = gtk_style_provider_get_settings (provider);
if (settings)
{
GdkScreen *screen = gdk_display_get_default_screen (_gtk_settings_get_display (settings));
@ -61,7 +61,7 @@ gtk_css_value_initial_compute (GtkCssValue *value,
break;
case GTK_CSS_PROPERTY_FONT_FAMILY:
settings = _gtk_style_provider_private_get_settings (provider);
settings = gtk_style_provider_get_settings (provider);
if (settings && gtk_settings_get_font_family (settings) != NULL)
return _gtk_css_array_value_new (_gtk_css_string_value_new (gtk_settings_get_font_family (settings)));
break;

View File

@ -436,7 +436,7 @@ _gtk_css_keyframes_print (GtkCssKeyframes *keyframes,
GtkCssKeyframes *
_gtk_css_keyframes_compute (GtkCssKeyframes *keyframes,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -444,7 +444,7 @@ _gtk_css_keyframes_compute (GtkCssKeyframes *keyframes,
guint k, p;
g_return_val_if_fail (keyframes != NULL, NULL);
g_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
g_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);

View File

@ -37,7 +37,7 @@ void _gtk_css_keyframes_print (GtkCssKeyframes
GString *string);
GtkCssKeyframes * _gtk_css_keyframes_compute (GtkCssKeyframes *keyframes,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style);

View File

@ -104,7 +104,7 @@ _gtk_css_lookup_set (GtkCssLookup *lookup,
**/
void
_gtk_css_lookup_resolve (GtkCssLookup *lookup,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStaticStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -49,7 +49,7 @@ void _gtk_css_lookup_set (GtkCssLookup
GtkCssSection *section,
GtkCssValue *value);
void _gtk_css_lookup_resolve (GtkCssLookup *lookup,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStaticStyle *style,
GtkCssStyle *parent_style);

View File

@ -115,7 +115,7 @@ struct _GtkCssNodeStyleChange {
static guint cssnode_signals[LAST_SIGNAL] = { 0 };
static GParamSpec *cssnode_properties[NUM_PROPERTIES];
static GtkStyleProviderPrivate *
static GtkStyleProvider *
gtk_css_node_get_style_provider_or_null (GtkCssNode *cssnode)
{
return GTK_CSS_NODE_GET_CLASS (cssnode)->get_style_provider (cssnode);
@ -287,7 +287,7 @@ gtk_css_node_is_last_child (GtkCssNode *node)
static gboolean
may_use_global_parent_cache (GtkCssNode *node)
{
GtkStyleProviderPrivate *provider;
GtkStyleProvider *provider;
GtkCssNode *parent;
parent = gtk_css_node_get_parent (node);
@ -500,7 +500,7 @@ gtk_css_node_real_get_widget_path (GtkCssNode *cssnode)
return NULL;
}
static GtkStyleProviderPrivate *
static GtkStyleProvider *
gtk_css_node_real_get_style_provider (GtkCssNode *cssnode)
{
return NULL;
@ -1386,10 +1386,10 @@ gtk_css_node_get_widget_path (GtkCssNode *cssnode)
return GTK_CSS_NODE_GET_CLASS (cssnode)->get_widget_path (cssnode);
}
GtkStyleProviderPrivate *
GtkStyleProvider *
gtk_css_node_get_style_provider (GtkCssNode *cssnode)
{
GtkStyleProviderPrivate *result;
GtkStyleProvider *result;
result = gtk_css_node_get_style_provider_or_null (cssnode);
if (result)
@ -1398,7 +1398,7 @@ gtk_css_node_get_style_provider (GtkCssNode *cssnode)
if (cssnode->parent)
return gtk_css_node_get_style_provider (cssnode->parent);
return GTK_STYLE_PROVIDER_PRIVATE (_gtk_settings_get_style_cascade (gtk_settings_get_default (), 1));
return GTK_STYLE_PROVIDER (_gtk_settings_get_style_cascade (gtk_settings_get_default (), 1));
}
void

View File

@ -80,7 +80,7 @@ struct _GtkCssNodeClass
GtkWidgetPath * (* create_widget_path) (GtkCssNode *cssnode);
const GtkWidgetPath * (* get_widget_path) (GtkCssNode *cssnode);
/* get style provider to use or NULL to use parent's */
GtkStyleProviderPrivate *(* get_style_provider) (GtkCssNode *cssnode);
GtkStyleProvider * (* get_style_provider) (GtkCssNode *cssnode);
/* get frame clock or NULL (only relevant for root node) */
GdkFrameClock * (* get_frame_clock) (GtkCssNode *cssnode);
GtkCssStyle * (* update_style) (GtkCssNode *cssnode,
@ -159,7 +159,7 @@ gboolean gtk_css_node_init_matcher (GtkCssNode *
GtkCssMatcher *matcher);
GtkWidgetPath * gtk_css_node_create_widget_path (GtkCssNode *cssnode);
const GtkWidgetPath * gtk_css_node_get_widget_path (GtkCssNode *cssnode);
GtkStyleProviderPrivate *gtk_css_node_get_style_provider(GtkCssNode *cssnode);
GtkStyleProvider * gtk_css_node_get_style_provider (GtkCssNode *cssnode);
void gtk_css_node_print (GtkCssNode *cssnode,
GtkStyleContextPrintFlags flags,

View File

@ -51,7 +51,7 @@ gtk_css_value_palette_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_palette_compute (GtkCssValue *specified,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -100,7 +100,7 @@ gtk_css_path_node_update_style (GtkCssNode *cssnode,
return GTK_CSS_NODE_CLASS (gtk_css_path_node_parent_class)->update_style (cssnode, change, 0, style);
}
static GtkStyleProviderPrivate *
static GtkStyleProvider *
gtk_css_path_node_get_style_provider (GtkCssNode *node)
{
GtkCssPathNode *path_node = GTK_CSS_PATH_NODE (node);

View File

@ -39,7 +39,7 @@ gtk_css_value_position_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_position_compute (GtkCssValue *position,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -132,9 +132,8 @@ static gboolean gtk_keep_css_sections = FALSE;
static guint css_provider_signals[LAST_SIGNAL] = { 0 };
static void gtk_css_provider_finalize (GObject *object);
static void gtk_css_style_provider_iface_init (GtkStyleProviderIface *iface);
static void gtk_css_style_provider_private_iface_init (GtkStyleProviderPrivateInterface *iface);
static void gtk_css_style_provider_emit_error (GtkStyleProviderPrivate *provider,
static void gtk_css_style_provider_iface_init (GtkStyleProviderInterface *iface);
static void gtk_css_style_provider_emit_error (GtkStyleProvider *provider,
GtkCssSection *section,
const GError *error);
@ -153,9 +152,7 @@ gtk_css_provider_error_quark (void)
G_DEFINE_TYPE_EXTENDED (GtkCssProvider, gtk_css_provider, G_TYPE_OBJECT, 0,
G_ADD_PRIVATE (GtkCssProvider)
G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
gtk_css_style_provider_iface_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER_PRIVATE,
gtk_css_style_provider_private_iface_init));
gtk_css_style_provider_iface_init));
static void
gtk_css_provider_parsing_error (GtkCssProvider *provider,
@ -328,7 +325,7 @@ gtk_css_scanner_destroy (GtkCssScanner *scanner)
}
static void
gtk_css_style_provider_emit_error (GtkStyleProviderPrivate *provider,
gtk_css_style_provider_emit_error (GtkStyleProvider *provider,
GtkCssSection *section,
const GError *error)
{
@ -340,7 +337,7 @@ gtk_css_provider_emit_error (GtkCssProvider *provider,
GtkCssScanner *scanner,
const GError *error)
{
gtk_css_style_provider_emit_error (GTK_STYLE_PROVIDER_PRIVATE (provider),
gtk_css_style_provider_emit_error (GTK_STYLE_PROVIDER (provider),
scanner ? scanner->section : NULL,
error);
}
@ -538,13 +535,8 @@ verify_tree_get_change_results (GtkCssProvider *provider,
}
static void
gtk_css_style_provider_iface_init (GtkStyleProviderIface *iface)
{
}
static GtkCssValue *
gtk_css_style_provider_get_color (GtkStyleProviderPrivate *provider,
gtk_css_style_provider_get_color (GtkStyleProvider *provider,
const char *name)
{
GtkCssProvider *css_provider = GTK_CSS_PROVIDER (provider);
@ -553,7 +545,7 @@ gtk_css_style_provider_get_color (GtkStyleProviderPrivate *provider,
}
static GtkCssKeyframes *
gtk_css_style_provider_get_keyframes (GtkStyleProviderPrivate *provider,
gtk_css_style_provider_get_keyframes (GtkStyleProvider *provider,
const char *name)
{
GtkCssProvider *css_provider = GTK_CSS_PROVIDER (provider);
@ -562,7 +554,7 @@ gtk_css_style_provider_get_keyframes (GtkStyleProviderPrivate *provider,
}
static void
gtk_css_style_provider_lookup (GtkStyleProviderPrivate *provider,
gtk_css_style_provider_lookup (GtkStyleProvider *provider,
const GtkCssMatcher *matcher,
GtkCssLookup *lookup,
GtkCssChange *change)
@ -626,7 +618,7 @@ gtk_css_style_provider_lookup (GtkStyleProviderPrivate *provider,
}
static void
gtk_css_style_provider_private_iface_init (GtkStyleProviderPrivateInterface *iface)
gtk_css_style_provider_iface_init (GtkStyleProviderInterface *iface)
{
iface->get_color = gtk_css_style_provider_get_color;
iface->get_keyframes = gtk_css_style_provider_get_keyframes;
@ -1495,7 +1487,7 @@ gtk_css_provider_load_from_data (GtkCssProvider *css_provider,
g_free (free_data);
_gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (css_provider));
gtk_style_provider_changed (GTK_STYLE_PROVIDER (css_provider));
}
/**
@ -1517,7 +1509,7 @@ gtk_css_provider_load_from_file (GtkCssProvider *css_provider,
gtk_css_provider_load_internal (css_provider, NULL, file, NULL);
_gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (css_provider));
gtk_style_provider_changed (GTK_STYLE_PROVIDER (css_provider));
}
/**

View File

@ -36,7 +36,7 @@ gtk_css_value_repeat_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_repeat_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -36,7 +36,7 @@ gtk_css_value_rgba_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_rgba_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -53,7 +53,7 @@ gtk_css_value_shadows_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_shadows_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -67,7 +67,7 @@ gtk_css_value_shadow_free (GtkCssValue *shadow)
static GtkCssValue *
gtk_css_value_shadow_compute (GtkCssValue *shadow,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -155,7 +155,7 @@ gtk_css_static_style_get_default (void)
GtkSettings *settings;
settings = gtk_settings_get_default ();
default_style = gtk_css_static_style_new_compute (GTK_STYLE_PROVIDER_PRIVATE (settings),
default_style = gtk_css_static_style_new_compute (GTK_STYLE_PROVIDER (settings),
NULL,
NULL);
g_object_set_data_full (G_OBJECT (settings), "gtk-default-style",
@ -166,7 +166,7 @@ gtk_css_static_style_get_default (void)
}
GtkCssStyle *
gtk_css_static_style_new_compute (GtkStyleProviderPrivate *provider,
gtk_css_static_style_new_compute (GtkStyleProvider *provider,
const GtkCssMatcher *matcher,
GtkCssStyle *parent)
{
@ -177,7 +177,7 @@ gtk_css_static_style_new_compute (GtkStyleProviderPrivate *provider,
lookup = _gtk_css_lookup_new (NULL);
if (matcher)
_gtk_style_provider_private_lookup (provider,
gtk_style_provider_lookup (provider,
matcher,
lookup,
&change);
@ -198,7 +198,7 @@ gtk_css_static_style_new_compute (GtkStyleProviderPrivate *provider,
void
gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *parent_style,
guint id,
GtkCssValue *specified,

View File

@ -53,12 +53,12 @@ struct _GtkCssStaticStyleClass
GType gtk_css_static_style_get_type (void) G_GNUC_CONST;
GtkCssStyle * gtk_css_static_style_get_default (void);
GtkCssStyle * gtk_css_static_style_new_compute (GtkStyleProviderPrivate *provider,
GtkCssStyle * gtk_css_static_style_new_compute (GtkStyleProvider *provider,
const GtkCssMatcher *matcher,
GtkCssStyle *parent);
void gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
GtkStyleProviderPrivate*provider,
GtkStyleProvider *provider,
GtkCssStyle *parent_style,
guint id,
GtkCssValue *specified,

View File

@ -36,7 +36,7 @@ gtk_css_value_string_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_string_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -259,7 +259,7 @@ static gboolean
gtk_css_transform_compute (GtkCssTransform *dest,
GtkCssTransform *src,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
@ -313,7 +313,7 @@ gtk_css_transform_compute (GtkCssTransform *dest,
static GtkCssValue *
gtk_css_value_transform_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -28,7 +28,6 @@ typedef union _GtkCssMatcher GtkCssMatcher;
typedef struct _GtkCssNode GtkCssNode;
typedef struct _GtkCssNodeDeclaration GtkCssNodeDeclaration;
typedef struct _GtkCssStyle GtkCssStyle;
typedef struct _GtkStyleProviderPrivate GtkStyleProviderPrivate; /* dummy typedef */
#define GTK_CSS_CHANGE_CLASS (1ULL << 0)
#define GTK_CSS_CHANGE_NAME (1ULL << 1)

View File

@ -37,7 +37,7 @@ gtk_css_value_unset_free (GtkCssValue *value)
static GtkCssValue *
gtk_css_value_unset_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -84,7 +84,7 @@ _gtk_css_value_unref (GtkCssValue *value)
GtkCssValue *
_gtk_css_value_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -42,7 +42,7 @@ struct _GtkCssValueClass {
GtkCssValue * (* compute) (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style);
gboolean (* equal) (const GtkCssValue *value1,
@ -66,7 +66,7 @@ void _gtk_css_value_unref (GtkCssValue
GtkCssValue *_gtk_css_value_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style);
gboolean _gtk_css_value_equal (const GtkCssValue *value1,

View File

@ -162,7 +162,7 @@ gtk_css_widget_node_get_widget_path (GtkCssNode *node)
return gtk_widget_get_path (widget_node->widget);
}
static GtkStyleProviderPrivate *
static GtkStyleProvider *
gtk_css_widget_node_get_style_provider (GtkCssNode *node)
{
GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
@ -178,7 +178,7 @@ gtk_css_widget_node_get_style_provider (GtkCssNode *node)
cascade = _gtk_settings_get_style_cascade (gtk_widget_get_settings (widget_node->widget),
gtk_widget_get_scale_factor (widget_node->widget));
return GTK_STYLE_PROVIDER_PRIVATE (cascade);
return GTK_STYLE_PROVIDER (cascade);
}
static GdkFrameClock *

View File

@ -120,7 +120,7 @@ gtk_css_value_win32_compute_size (const GtkCssValue *value)
static GtkCssValue *
gtk_css_value_win32_size_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkStyleProvider *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{

View File

@ -194,8 +194,7 @@ enum {
};
/* --- prototypes --- */
static void gtk_settings_provider_iface_init (GtkStyleProviderIface *iface);
static void gtk_settings_provider_private_init (GtkStyleProviderPrivateInterface *iface);
static void gtk_settings_provider_iface_init (GtkStyleProviderInterface *iface);
static void gtk_settings_finalize (GObject *object);
static void gtk_settings_get_property (GObject *object,
@ -245,9 +244,7 @@ static GPtrArray *display_settings;
G_DEFINE_TYPE_EXTENDED (GtkSettings, gtk_settings, G_TYPE_OBJECT, 0,
G_ADD_PRIVATE (GtkSettings)
G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
gtk_settings_provider_iface_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER_PRIVATE,
gtk_settings_provider_private_init));
gtk_settings_provider_iface_init));
/* --- functions --- */
static void
@ -1072,19 +1069,14 @@ gtk_settings_class_init (GtkSettingsClass *class)
g_assert (result == PROP_KEYNAV_USE_CARET);
}
static void
gtk_settings_provider_iface_init (GtkStyleProviderIface *iface)
{
}
static GtkSettings *
gtk_settings_style_provider_get_settings (GtkStyleProviderPrivate *provider)
gtk_settings_style_provider_get_settings (GtkStyleProvider *provider)
{
return GTK_SETTINGS (provider);
}
static void
gtk_settings_provider_private_init (GtkStyleProviderPrivateInterface *iface)
gtk_settings_provider_iface_init (GtkStyleProviderInterface *iface)
{
iface->get_settings = gtk_settings_style_provider_get_settings;
}
@ -1331,7 +1323,7 @@ gtk_settings_set_property (GObject *object,
static void
settings_invalidate_style (GtkSettings *settings)
{
_gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (settings));
gtk_style_provider_changed (GTK_STYLE_PROVIDER (settings));
}
static void

View File

@ -96,13 +96,8 @@ gtk_style_cascade_iter_clear (GtkStyleCascadeIter *iter)
g_free (iter->cascade_index);
}
static void
gtk_style_cascade_provider_iface_init (GtkStyleProviderIface *iface)
{
}
static GtkSettings *
gtk_style_cascade_get_settings (GtkStyleProviderPrivate *provider)
gtk_style_cascade_get_settings (GtkStyleProvider *provider)
{
GtkStyleCascade *cascade = GTK_STYLE_CASCADE (provider);
GtkStyleCascadeIter iter;
@ -113,10 +108,10 @@ gtk_style_cascade_get_settings (GtkStyleProviderPrivate *provider)
item;
item = gtk_style_cascade_iter_next (cascade, &iter))
{
if (!GTK_IS_STYLE_PROVIDER_PRIVATE (item))
if (!GTK_IS_STYLE_PROVIDER (item))
continue;
settings = _gtk_style_provider_private_get_settings (GTK_STYLE_PROVIDER_PRIVATE (item));
settings = gtk_style_provider_get_settings (GTK_STYLE_PROVIDER (item));
if (settings)
{
gtk_style_cascade_iter_clear (&iter);
@ -129,7 +124,7 @@ gtk_style_cascade_get_settings (GtkStyleProviderPrivate *provider)
}
static GtkCssValue *
gtk_style_cascade_get_color (GtkStyleProviderPrivate *provider,
gtk_style_cascade_get_color (GtkStyleProvider *provider,
const char *name)
{
GtkStyleCascade *cascade = GTK_STYLE_CASCADE (provider);
@ -141,9 +136,9 @@ gtk_style_cascade_get_color (GtkStyleProviderPrivate *provider,
item;
item = gtk_style_cascade_iter_next (cascade, &iter))
{
if (GTK_IS_STYLE_PROVIDER_PRIVATE (item))
if (GTK_IS_STYLE_PROVIDER (item))
{
color = _gtk_style_provider_private_get_color (GTK_STYLE_PROVIDER_PRIVATE (item), name);
color = gtk_style_provider_get_color (GTK_STYLE_PROVIDER (item), name);
if (color)
{
gtk_style_cascade_iter_clear (&iter);
@ -161,7 +156,7 @@ gtk_style_cascade_get_color (GtkStyleProviderPrivate *provider,
}
static int
gtk_style_cascade_get_scale (GtkStyleProviderPrivate *provider)
gtk_style_cascade_get_scale (GtkStyleProvider *provider)
{
GtkStyleCascade *cascade = GTK_STYLE_CASCADE (provider);
@ -169,7 +164,7 @@ gtk_style_cascade_get_scale (GtkStyleProviderPrivate *provider)
}
static GtkCssKeyframes *
gtk_style_cascade_get_keyframes (GtkStyleProviderPrivate *provider,
gtk_style_cascade_get_keyframes (GtkStyleProvider *provider,
const char *name)
{
GtkStyleCascade *cascade = GTK_STYLE_CASCADE (provider);
@ -181,10 +176,10 @@ gtk_style_cascade_get_keyframes (GtkStyleProviderPrivate *provider,
item;
item = gtk_style_cascade_iter_next (cascade, &iter))
{
if (!GTK_IS_STYLE_PROVIDER_PRIVATE (item))
if (!GTK_IS_STYLE_PROVIDER (item))
continue;
keyframes = _gtk_style_provider_private_get_keyframes (GTK_STYLE_PROVIDER_PRIVATE (item), name);
keyframes = gtk_style_provider_get_keyframes (GTK_STYLE_PROVIDER (item), name);
if (keyframes)
{
gtk_style_cascade_iter_clear (&iter);
@ -197,7 +192,7 @@ gtk_style_cascade_get_keyframes (GtkStyleProviderPrivate *provider,
}
static void
gtk_style_cascade_lookup (GtkStyleProviderPrivate *provider,
gtk_style_cascade_lookup (GtkStyleProvider *provider,
const GtkCssMatcher *matcher,
GtkCssLookup *lookup,
GtkCssChange *change)
@ -211,10 +206,10 @@ gtk_style_cascade_lookup (GtkStyleProviderPrivate *provider,
item;
item = gtk_style_cascade_iter_next (cascade, &iter))
{
GtkStyleProviderPrivate *sp = (GtkStyleProviderPrivate*)item;
if (GTK_IS_STYLE_PROVIDER_PRIVATE (sp))
GtkStyleProvider *sp = (GtkStyleProvider *) item;
if (GTK_IS_STYLE_PROVIDER (sp))
{
_gtk_style_provider_private_lookup (sp, matcher, lookup,
gtk_style_provider_lookup (sp, matcher, lookup,
change ? &iter_change : NULL);
if (change)
*change |= iter_change;
@ -229,7 +224,7 @@ gtk_style_cascade_lookup (GtkStyleProviderPrivate *provider,
}
static void
gtk_style_cascade_provider_private_iface_init (GtkStyleProviderPrivateInterface *iface)
gtk_style_cascade_provider_iface_init (GtkStyleProviderInterface *iface)
{
iface->get_color = gtk_style_cascade_get_color;
iface->get_settings = gtk_style_cascade_get_settings;
@ -240,9 +235,7 @@ gtk_style_cascade_provider_private_iface_init (GtkStyleProviderPrivateInterface
G_DEFINE_TYPE_EXTENDED (GtkStyleCascade, _gtk_style_cascade, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
gtk_style_cascade_provider_iface_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER_PRIVATE,
gtk_style_cascade_provider_private_iface_init));
gtk_style_cascade_provider_iface_init));
static void
gtk_style_cascade_dispose (GObject *object)
@ -302,14 +295,14 @@ _gtk_style_cascade_set_parent (GtkStyleCascade *cascade,
g_object_ref (parent);
g_signal_connect_swapped (parent,
"-gtk-private-changed",
G_CALLBACK (_gtk_style_provider_private_changed),
G_CALLBACK (gtk_style_provider_changed),
cascade);
}
if (cascade->parent)
{
g_signal_handlers_disconnect_by_func (cascade->parent,
_gtk_style_provider_private_changed,
gtk_style_provider_changed,
cascade);
g_object_unref (cascade->parent);
}
@ -333,7 +326,7 @@ _gtk_style_cascade_add_provider (GtkStyleCascade *cascade,
data.priority = priority;
data.changed_signal_id = g_signal_connect_swapped (provider,
"-gtk-private-changed",
G_CALLBACK (_gtk_style_provider_private_changed),
G_CALLBACK (gtk_style_provider_changed),
cascade);
/* ensure it gets removed first */
@ -346,7 +339,7 @@ _gtk_style_cascade_add_provider (GtkStyleCascade *cascade,
}
g_array_insert_val (cascade->providers, i, data);
_gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (cascade));
gtk_style_provider_changed (GTK_STYLE_PROVIDER (cascade));
}
void
@ -366,7 +359,7 @@ _gtk_style_cascade_remove_provider (GtkStyleCascade *cascade,
{
g_array_remove_index (cascade->providers, i);
_gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (cascade));
gtk_style_provider_changed (GTK_STYLE_PROVIDER (cascade));
break;
}
}
@ -383,7 +376,7 @@ _gtk_style_cascade_set_scale (GtkStyleCascade *cascade,
cascade->scale = scale;
_gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (cascade));
gtk_style_provider_changed (GTK_STYLE_PROVIDER (cascade));
}
int

View File

@ -409,12 +409,12 @@ gtk_style_context_get_root (GtkStyleContext *context)
return priv->cssnode;
}
GtkStyleProviderPrivate *
GtkStyleProvider *
gtk_style_context_get_style_provider (GtkStyleContext *context)
{
GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context);
return GTK_STYLE_PROVIDER_PRIVATE (priv->cascade);
return GTK_STYLE_PROVIDER (priv->cascade);
}
static gboolean
@ -1451,7 +1451,7 @@ _gtk_style_context_resolve_color (GtkStyleContext *context,
g_return_val_if_fail (result != NULL, FALSE);
val = _gtk_css_color_value_resolve (color,
GTK_STYLE_PROVIDER_PRIVATE (priv->cascade),
GTK_STYLE_PROVIDER (priv->cascade),
_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_COLOR),
NULL);
if (val == NULL)
@ -1484,7 +1484,7 @@ gtk_style_context_lookup_color (GtkStyleContext *context,
g_return_val_if_fail (color_name != NULL, FALSE);
g_return_val_if_fail (color != NULL, FALSE);
value = _gtk_style_provider_private_get_color (GTK_STYLE_PROVIDER_PRIVATE (priv->cascade), color_name);
value = gtk_style_provider_get_color (GTK_STYLE_PROVIDER (priv->cascade), color_name);
if (value == NULL)
return FALSE;

View File

@ -34,7 +34,7 @@ GtkCssNode *gtk_style_context_get_node (GtkStyleContext *c
void gtk_style_context_set_id (GtkStyleContext *context,
const char *id);
const char * gtk_style_context_get_id (GtkStyleContext *context);
GtkStyleProviderPrivate *
GtkStyleProvider *
gtk_style_context_get_style_provider (GtkStyleContext *context);
void gtk_style_context_save_named (GtkStyleContext *context,

View File

@ -17,7 +17,7 @@
#include "config.h"
#include "gtkstyleprovider.h"
#include "gtkstyleproviderprivate.h"
#include "gtkintl.h"
#include "gtkprivate.h"
@ -33,23 +33,135 @@
* See gtk_style_context_add_provider() and gtk_style_context_add_provider_for_display().
*/
static void gtk_style_provider_iface_init (gpointer g_iface);
enum {
CHANGED,
LAST_SIGNAL
};
GType
gtk_style_provider_get_type (void)
{
static GType style_provider_type = 0;
G_DEFINE_INTERFACE (GtkStyleProvider, gtk_style_provider, GTK_TYPE_STYLE_PROVIDER)
if (!style_provider_type)
style_provider_type = g_type_register_static_simple (G_TYPE_INTERFACE,
I_("GtkStyleProvider"),
sizeof (GtkStyleProviderIface),
(GClassInitFunc) gtk_style_provider_iface_init,
0, NULL, 0);
return style_provider_type;
}
static guint signals[LAST_SIGNAL];
static void
gtk_style_provider_iface_init (gpointer g_iface)
gtk_style_provider_default_init (GtkStyleProviderInterface *iface)
{
signals[CHANGED] = g_signal_new (I_("-gtk-private-changed"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkStyleProviderInterface, changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
GtkCssValue *
gtk_style_provider_get_color (GtkStyleProvider *provider,
const char *name)
{
GtkStyleProviderInterface *iface;
/* for compat with gtk_symbolic_color_resolve() */
if (provider == NULL)
return NULL;
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
iface = GTK_STYLE_PROVIDER_GET_INTERFACE (provider);
if (!iface->get_color)
return NULL;
return iface->get_color (provider, name);
}
GtkCssKeyframes *
gtk_style_provider_get_keyframes (GtkStyleProvider *provider,
const char *name)
{
GtkStyleProviderInterface *iface;
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
gtk_internal_return_val_if_fail (name != NULL, NULL);
iface = GTK_STYLE_PROVIDER_GET_INTERFACE (provider);
if (!iface->get_keyframes)
return NULL;
return iface->get_keyframes (provider, name);
}
void
gtk_style_provider_lookup (GtkStyleProvider *provider,
const GtkCssMatcher *matcher,
GtkCssLookup *lookup,
GtkCssChange *out_change)
{
GtkStyleProviderInterface *iface;
gtk_internal_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
gtk_internal_return_if_fail (matcher != NULL);
gtk_internal_return_if_fail (lookup != NULL);
if (out_change)
*out_change = 0;
iface = GTK_STYLE_PROVIDER_GET_INTERFACE (provider);
if (!iface->lookup)
return;
iface->lookup (provider, matcher, lookup, out_change);
}
void
gtk_style_provider_changed (GtkStyleProvider *provider)
{
gtk_internal_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
g_signal_emit (provider, signals[CHANGED], 0);
}
GtkSettings *
gtk_style_provider_get_settings (GtkStyleProvider *provider)
{
GtkStyleProviderInterface *iface;
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
iface = GTK_STYLE_PROVIDER_GET_INTERFACE (provider);
if (!iface->get_settings)
return NULL;
return iface->get_settings (provider);
}
int
gtk_style_provider_get_scale (GtkStyleProvider *provider)
{
GtkStyleProviderInterface *iface;
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), 1);
iface = GTK_STYLE_PROVIDER_GET_INTERFACE (provider);
if (!iface->get_scale)
return 1;
return iface->get_scale (provider);
}
void
gtk_style_provider_emit_error (GtkStyleProvider *provider,
GtkCssSection *section,
GError *error)
{
GtkStyleProviderInterface *iface;
iface = GTK_STYLE_PROVIDER_GET_INTERFACE (provider);
if (iface->emit_error)
iface->emit_error (provider, section, error);
}

View File

@ -31,7 +31,6 @@ G_BEGIN_DECLS
#define GTK_TYPE_STYLE_PROVIDER (gtk_style_provider_get_type ())
#define GTK_STYLE_PROVIDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_PROVIDER, GtkStyleProvider))
#define GTK_IS_STYLE_PROVIDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_PROVIDER))
#define GTK_STYLE_PROVIDER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GTK_TYPE_STYLE_PROVIDER, GtkStyleProviderIface))
/**
* GTK_STYLE_PROVIDER_PRIORITY_FALLBACK:
@ -84,18 +83,8 @@ G_BEGIN_DECLS
*/
#define GTK_STYLE_PROVIDER_PRIORITY_USER 800
typedef struct _GtkStyleProviderIface GtkStyleProviderIface;
typedef struct _GtkStyleProvider GtkStyleProvider; /* dummy typedef */
/**
* GtkStyleProviderIface:
*/
struct _GtkStyleProviderIface
{
/*< private >*/
GTypeInterface g_iface;
};
GDK_AVAILABLE_IN_ALL
GType gtk_style_provider_get_type (void) G_GNUC_CONST;

View File

@ -1,157 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2011 Benjamin Otte <otte@gnome.org>
*
* 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 "gtkstyleproviderprivate.h"
#include "gtkintl.h"
#include "gtkstyleprovider.h"
#include "gtkprivate.h"
enum {
CHANGED,
LAST_SIGNAL
};
G_DEFINE_INTERFACE (GtkStyleProviderPrivate, _gtk_style_provider_private, GTK_TYPE_STYLE_PROVIDER)
static guint signals[LAST_SIGNAL];
static void
_gtk_style_provider_private_default_init (GtkStyleProviderPrivateInterface *iface)
{
signals[CHANGED] = g_signal_new (I_("-gtk-private-changed"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkStyleProviderPrivateInterface, changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
GtkCssValue *
_gtk_style_provider_private_get_color (GtkStyleProviderPrivate *provider,
const char *name)
{
GtkStyleProviderPrivateInterface *iface;
/* for compat with gtk_symbolic_color_resolve() */
if (provider == NULL)
return NULL;
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
if (!iface->get_color)
return NULL;
return iface->get_color (provider, name);
}
GtkCssKeyframes *
_gtk_style_provider_private_get_keyframes (GtkStyleProviderPrivate *provider,
const char *name)
{
GtkStyleProviderPrivateInterface *iface;
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
gtk_internal_return_val_if_fail (name != NULL, NULL);
iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
if (!iface->get_keyframes)
return NULL;
return iface->get_keyframes (provider, name);
}
void
_gtk_style_provider_private_lookup (GtkStyleProviderPrivate *provider,
const GtkCssMatcher *matcher,
GtkCssLookup *lookup,
GtkCssChange *out_change)
{
GtkStyleProviderPrivateInterface *iface;
gtk_internal_return_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider));
gtk_internal_return_if_fail (matcher != NULL);
gtk_internal_return_if_fail (lookup != NULL);
if (out_change)
*out_change = 0;
iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
if (!iface->lookup)
return;
iface->lookup (provider, matcher, lookup, out_change);
}
void
_gtk_style_provider_private_changed (GtkStyleProviderPrivate *provider)
{
gtk_internal_return_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider));
g_signal_emit (provider, signals[CHANGED], 0);
}
GtkSettings *
_gtk_style_provider_private_get_settings (GtkStyleProviderPrivate *provider)
{
GtkStyleProviderPrivateInterface *iface;
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
if (!iface->get_settings)
return NULL;
return iface->get_settings (provider);
}
int
_gtk_style_provider_private_get_scale (GtkStyleProviderPrivate *provider)
{
GtkStyleProviderPrivateInterface *iface;
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), 1);
iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
if (!iface->get_scale)
return 1;
return iface->get_scale (provider);
}
void
_gtk_style_provider_private_emit_error (GtkStyleProviderPrivate *provider,
GtkCssSection *section,
GError *error)
{
GtkStyleProviderPrivateInterface *iface;
iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
if (iface->emit_error)
iface->emit_error (provider, section, error);
}

View File

@ -27,51 +27,45 @@
G_BEGIN_DECLS
#define GTK_TYPE_STYLE_PROVIDER_PRIVATE (_gtk_style_provider_private_get_type ())
#define GTK_STYLE_PROVIDER_PRIVATE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_PROVIDER_PRIVATE, GtkStyleProviderPrivate))
#define GTK_IS_STYLE_PROVIDER_PRIVATE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_PROVIDER_PRIVATE))
#define GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GTK_TYPE_STYLE_PROVIDER_PRIVATE, GtkStyleProviderPrivateInterface))
#define GTK_STYLE_PROVIDER_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GTK_TYPE_STYLE_PROVIDER, GtkStyleProviderInterface))
typedef struct _GtkStyleProviderPrivateInterface GtkStyleProviderPrivateInterface;
/* typedef struct _GtkStyleProviderPrivate GtkStyleProviderPrivate; */ /* dummy typedef */
typedef struct _GtkStyleProviderInterface GtkStyleProviderInterface;
struct _GtkStyleProviderPrivateInterface
struct _GtkStyleProviderInterface
{
GTypeInterface g_iface;
GtkCssValue * (* get_color) (GtkStyleProviderPrivate *provider,
GtkCssValue * (* get_color) (GtkStyleProvider *provider,
const char *name);
GtkSettings * (* get_settings) (GtkStyleProviderPrivate *provider);
GtkCssKeyframes * (* get_keyframes) (GtkStyleProviderPrivate *provider,
GtkSettings * (* get_settings) (GtkStyleProvider *provider);
GtkCssKeyframes * (* get_keyframes) (GtkStyleProvider *provider,
const char *name);
int (* get_scale) (GtkStyleProviderPrivate *provider);
void (* lookup) (GtkStyleProviderPrivate *provider,
int (* get_scale) (GtkStyleProvider *provider);
void (* lookup) (GtkStyleProvider *provider,
const GtkCssMatcher *matcher,
GtkCssLookup *lookup,
GtkCssChange *out_change);
void (* emit_error) (GtkStyleProviderPrivate *provider,
void (* emit_error) (GtkStyleProvider *provider,
GtkCssSection *section,
const GError *error);
/* signal */
void (* changed) (GtkStyleProviderPrivate *provider);
void (* changed) (GtkStyleProvider *provider);
};
GType _gtk_style_provider_private_get_type (void) G_GNUC_CONST;
GtkSettings * _gtk_style_provider_private_get_settings (GtkStyleProviderPrivate *provider);
GtkCssValue * _gtk_style_provider_private_get_color (GtkStyleProviderPrivate *provider,
GtkSettings * gtk_style_provider_get_settings (GtkStyleProvider *provider);
GtkCssValue * gtk_style_provider_get_color (GtkStyleProvider *provider,
const char *name);
GtkCssKeyframes * _gtk_style_provider_private_get_keyframes(GtkStyleProviderPrivate *provider,
GtkCssKeyframes * gtk_style_provider_get_keyframes (GtkStyleProvider *provider,
const char *name);
int _gtk_style_provider_private_get_scale (GtkStyleProviderPrivate *provider);
void _gtk_style_provider_private_lookup (GtkStyleProviderPrivate *provider,
int gtk_style_provider_get_scale (GtkStyleProvider *provider);
void gtk_style_provider_lookup (GtkStyleProvider *provider,
const GtkCssMatcher *matcher,
GtkCssLookup *lookup,
GtkCssChange *out_change);
void _gtk_style_provider_private_changed (GtkStyleProviderPrivate *provider);
void gtk_style_provider_changed (GtkStyleProvider *provider);
void _gtk_style_provider_private_emit_error (GtkStyleProviderPrivate *provider,
void gtk_style_provider_emit_error (GtkStyleProvider *provider,
GtkCssSection *section,
GError *error);

View File

@ -307,7 +307,6 @@ gtk_public_sources = files([
'gtkstylecontext.c',
'gtkstyleproperty.c',
'gtkstyleprovider.c',
'gtkstyleproviderprivate.c',
'gtkswitch.c',
'gtktestutils.c',
'gtktextattributes.c',