summaryrefslogtreecommitdiff
path: root/gtk/gtkcssmatcher.c
Commit message (Collapse)AuthorAgeFilesLines
* cssmatcher: Remove type argument from name matcherBenjamin Otte2016-02-051-25/+8
| | | | We no longer use types when matching names.
* cssmatcher: Actually match names for widget pathsBenjamin Otte2015-10-271-5/+10
| | | | | The type is always 0 when we use names. So this would always return FALSE. Oops.
* API: Add gtk_widget_path_iter_set_object_name()Benjamin Otte2015-10-271-2/+16
| | | | | | | | ... and gtk_widget_path_iter_get_object_name(). This allows applications that still use widget paths to use the new object names to get the correct styling. Mutter and webkit-gtk are examples here.
* cssmatcher: Remove matching API for regionsBenjamin Otte2015-10-221-148/+0
|
* cssmatcher: Marshal name to matcherBenjamin Otte2015-10-221-14/+26
| | | | | | | ... and use it in the node matcher. Also rename function from _gtk_css_matcher_get_type() to _gtk_css_matcher_get_name().
* css matcher: Avoid a redundant callMatthias Clasen2015-09-121-1/+2
| | | | | The sole caller passes an interned string, so we don't need to call g_intern_string again.
* cssmatcher: Make nth-child(odd) work on first lineBenjamin Otte2015-07-061-2/+2
| | | | .. instead of only on 3rd, 5th, 7th, ...
* cssmatcher: Speed up common matchingBenjamin Otte2015-05-281-3/+12
| | | | | first-child and last-child are the most common usages of the nth-child machinery, so special-casing them makes sense.
* cssmatcher: Rewrite nth-child matcherBenjamin Otte2015-05-281-16/+12
| | | | | | Instead of trying to be smart, be stupid but correct. Fixes nth-child reftest.
* cssmatcher: Simplify codeBenjamin Otte2015-05-281-34/+7
| | | | | | Instead of copy/paste, pass the only difference as an argument The code still doesn't work right, but at least it's easier to fix now.
* cssnode: Add visibility conceptBenjamin Otte2015-03-181-5/+25
| | | | | This allows hiding nodes of invisible widgets. And that in turn makes sure :nth-child() works as expected.
* cssnode: Remove now unused arg from vfuncBenjamin Otte2015-03-181-2/+2
|
* cssnode: Add a matcher for nodesBenjamin Otte2015-03-181-0/+179
| | | | ... and use that matcher by default - ie for transient nodes.
* cssmatcher: Allow widget path matcher to take a node declarationBenjamin Otte2015-03-181-3/+34
| | | | | | | 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.
* css: Match state in siblings properlyBenjamin Otte2014-08-131-1/+7
| | | | | | | Previously, we always returned the state flags of the original widget and did not consider the siblings' pseudoclasses. Testcase is attached.
* cssmatcher: Use widget path's stateBenjamin Otte2014-07-191-6/+2
| | | | | | | | Don't take a state when constructing the CSS matcher. Instead, rely on the newly introduced state in the widget path. This way, the state can be queried not only on the first element, but on all elements of the widget path.
* Avoid deprecation warningsMatthias Clasen2014-06-241-1/+5
| | | | We know regions are deprecated, no need to warn about it here.
* css parser: Add :link and :visitedTimm Bäder2013-11-041-2/+4
| | | | | | | ... which are both to be used for links instead of the current -GtkWidget-link-color and -GtkWidget-visited-link-color https://bugzilla.gnome.org/show_bug.cgi?id=709629
* css: Speed up name matchingAlexander Larsson2012-12-101-13/+11
| | | | | | | | | We use the new g_type_get_type_registration_serial() so that we can cache and properly invalidate the result of g_type_from_name(). This bumps the glib requirement to 2.35.3 to get the new function. https://bugzilla.gnome.org/show_bug.cgi?id=689847
* css: Add _gtk_css_matcher_matches_any()Alexander Larsson2012-11-301-0/+3
| | | | | | | This returns true if the matcher matches *anything*. We need to check this later, because such matchers are dangerous in loops that iterate over all parents/siblings since such loops would not terminate.
* cssmatcher: Handle case of empty widget pathBenjamin Otte2012-05-011-1/+6
| | | | This is tested by the stylecontext test, but doesn't appear in practice.
* cssmatcher: Use quarks for classesBenjamin Otte2012-04-171-5/+5
|
* matcher: Add a superset matcherBenjamin Otte2012-04-171-0/+125
| | | | | | This matcher always matches only on some relvant things and ignores the rest. This allows you to match only on name and class, but ignore state and parents/siblings for example.
* matcher: Add a matcher that matches anythingBenjamin Otte2012-04-171-0/+92
| | | | | Lesson learned: Adwaita uses all possible selector types and all of those for parents, too. But so far no siblings.
* selector: Rewrite position trackingBenjamin Otte2012-04-171-12/+22
| | | | | | | | | We now track the position as a (type,a,b) tuple where the numbers make up the an + b formula from CSS3 nth-child. Also, the get_sibling() and get_sibling_index() vfuncs were replaced by a has_position() vfunc. This is mostly so that the matcher can always return TRUE. And I need that for the everything matcher.
* matcher: Turn GtkCssMatcher into a unionBenjamin Otte2012-04-171-40/+42
| | | | That way, we can add more matchers as we need them.
* matcher: Use a vtableBenjamin Otte2012-04-171-38/+54
| | | | Now we can do lots of fancy matchers, yay!
* css: Make the style provider take a matcher as an input argumentBenjamin Otte2012-04-171-4/+3
|
* css: Add GtkCssMatcherBenjamin Otte2012-04-171-0/+174
This is so we can later do matching with other things than GtkWidgetPath. In particular, this is a requirement for getting rid of GtkWidgetPath.