Add a function to dump CSS nodes and styles

Add a gtk_style_context_to_string function that can serialize
a CSS node or tree of nodes, optionally including CSS properties
as well.

This will be useful in writing tests.
This commit is contained in:
Matthias Clasen
2015-12-28 01:09:54 -05:00
parent a6624d803e
commit 68edc47f6a
5 changed files with 257 additions and 1 deletions

View File

@ -1208,6 +1208,17 @@ void gtk_draw_insertion_cursor (GtkWidget *widget,
GtkTextDirection direction,
gboolean draw_arrow);
typedef enum {
GTK_STYLE_CONTEXT_PRINT_NONE = 0,
GTK_STYLE_CONTEXT_PRINT_RECURSE = 1 << 0,
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE = 1 << 1,
GTK_STYLE_CONTEXT_PRINT_SHOW_INITIAL = 1 << 2
} GtkStyleContextPrintFlags;
GDK_AVAILABLE_IN_3_20
char * gtk_style_context_to_string (GtkStyleContext *context,
GtkStyleContextPrintFlags flags);
G_END_DECLS
#endif /* __GTK_STYLE_CONTEXT_H__ */