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:
@ -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__ */
|
||||
|
||||
Reference in New Issue
Block a user