mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
csstokenizer: Add save() and restore()
We'll need that to check if property values contain variables.
This commit is contained in:
parent
46ab71fc8a
commit
2437a551ec
@ -36,6 +36,9 @@ struct _GtkCssTokenizer
|
||||
const char *end;
|
||||
|
||||
GtkCssLocation position;
|
||||
|
||||
GtkCssLocation saved_position;
|
||||
const char *saved_data;
|
||||
};
|
||||
|
||||
void
|
||||
@ -1484,3 +1487,23 @@ gtk_css_tokenizer_read_token (GtkCssTokenizer *tokenizer,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_css_tokenizer_save (GtkCssTokenizer *tokenizer)
|
||||
{
|
||||
g_assert (!tokenizer->saved_data);
|
||||
|
||||
tokenizer->saved_position = tokenizer->position;
|
||||
tokenizer->saved_data = tokenizer->data;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_css_tokenizer_restore (GtkCssTokenizer *tokenizer)
|
||||
{
|
||||
g_assert (tokenizer->saved_data);
|
||||
|
||||
tokenizer->position = tokenizer->saved_position;
|
||||
tokenizer->data = tokenizer->saved_data;
|
||||
|
||||
gtk_css_location_init (&tokenizer->saved_position);
|
||||
tokenizer->saved_data = NULL;
|
||||
}
|
||||
|
@ -148,5 +148,8 @@ gboolean gtk_css_tokenizer_read_token (GtkCssTokenizer
|
||||
GtkCssToken *token,
|
||||
GError **error);
|
||||
|
||||
void gtk_css_tokenizer_save (GtkCssTokenizer *tokenizer);
|
||||
void gtk_css_tokenizer_restore (GtkCssTokenizer *tokenizer);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user