CSS provider: Add a way to emit errors

Currently, GtkCssProvider can emit ::parsing-error only during
the actual parsing, although the documentation hints that it might
happen at other times.

This commit adds a emit_error method to the GtkStyleProviderPrivate
interface that will let us emit errors from the compute() implementations
as well, which can be useful (e.g. if an image fails to load).
This commit is contained in:
Matthias Clasen
2016-01-29 22:45:21 -05:00
parent 63bf90ae71
commit 2c7fdf6432
3 changed files with 37 additions and 10 deletions

View File

@ -49,7 +49,9 @@ struct _GtkStyleProviderPrivateInterface
const GtkCssMatcher *matcher,
GtkCssLookup *lookup,
GtkCssChange *out_change);
void (* emit_error) (GtkStyleProviderPrivate *provider,
GtkCssSection *section,
const GError *error);
/* signal */
void (* changed) (GtkStyleProviderPrivate *provider);
};
@ -69,6 +71,10 @@ void _gtk_style_provider_private_lookup (GtkStyleProvid
void _gtk_style_provider_private_changed (GtkStyleProviderPrivate *provider);
void _gtk_style_provider_private_emit_error (GtkStyleProviderPrivate *provider,
GtkCssSection *section,
GError *error);
G_END_DECLS
#endif /* __GTK_STYLE_PROVIDER_PRIVATE_H__ */