Commit Graph

10 Commits

Author SHA1 Message Date
Benjamin Otte
9b9b475f0a API: stylecontext: Remove regions 2016-10-16 18:17:21 +02:00
Matthias Clasen
0c52eca34c Move node printing to GtkCssNodeDeclaration
The node declaration has all the information we are printing
here (except for visibility). At the same time, redo the format
to print the information in selector format, and indicate
(in)visibility by enclosing the selector in square brackets.
2016-01-03 14:41:43 -05:00
Benjamin Otte
26450a661e cssnodedeclaration: Add possibility to set the name
This is supposed to be a replacement for setting the type. So far, both
options are possible - either will unset the other.
2015-10-22 16:35:14 +02:00
Benjamin Otte
c6a5a12922 widgetpath: Implement using GtkCssNodeDeclaration
This removes a bunch of code but more importantly allows providing the
declaration in CSS matchers.
2015-09-12 05:27:35 +02:00
Benjamin Otte
610452dda8 cssnode: Move clear_classes() into the NodeDeclaration
The previous code was crashing when used as the returned classes array
would have been invalid after the first deletion. So if a 2nd class
would be deleted, invalid memory might have been referenced.
2015-09-12 05:27:35 +02:00
Garrett Regier
41b386cd6a cssnode: Optimize listing of classes
Avoid creating the GList of strings when the GQuarks
will just be determined again. Instead have
gtk_style_context_list_classes() do it specifically.
2015-09-11 18:26:11 +02:00
Benjamin Otte
2bf7bdd651 cssmatcher: Allow widget path matcher to take a node declaration
The node declaration has the same functionality as
gtk_css_node_declaration_add_to_widget_path(). So instead of using that
function on a path, you can use the original path and the declaration in
a matcher.
2015-03-18 15:23:30 +01:00
Benjamin Otte
dbb8d1dd07 stylecontext: Keep track of the CSS ID
This is necessary since we do the new caching and need to distinguish
between styles with different IDs.

Fixes various test cases.
2015-01-20 01:07:13 +01:00
Benjamin Otte
26f36ef8ae cssnodedeclaration: Store the GType of the node 2015-01-07 14:26:48 +01:00
Benjamin Otte
5c2c659122 stylecontext: Split out functionality into custom object
GtkCssNodeDeclaration is a new struct with copy-on-write semantics.

It encapsulated the properties used to define a node in the CSS tree.

The idea is to use it in various places for caching, in particular as
key in hash tables.
2014-10-21 03:03:28 +02:00