summaryrefslogtreecommitdiff
path: root/gtk/gtkcssnode.c
Commit message (Collapse)AuthorAgeFilesLines
* Add some va marshallers to frequent signalsMatthias Clasen2016-05-051-0/+11
| | | | This makes us take the fast path in signal emission.
* inspector: Wording changesMatthias Clasen2016-03-091-12/+6
| | | | | Align the property nicks of GtkCssNode with the column names in the inspector node tree.
* cssnode: Don't leak the style cache on destructionBenjamin Otte2016-01-181-0/+3
|
* cssnode: Redo GTK_DEBUG=no-css-cacheBenjamin Otte2016-01-161-18/+0
| | | | | | | | Previously this setting would just invalidate the whole CSS tree and thereby hopefully avoid all cache usage. Now, we actually don't cause extra invalidations anymore, but instead avoid ever inserting anything into the cache when this setting is set.
* cssnode: Split out the style cacheBenjamin Otte2016-01-161-96/+27
| | | | | | For now, the split out style cache doesn't cache anything. This is mostly to make sure that bisections of wrong caching behavior will bisect down to the commit that actually adds caching.
* Improve formatting of CSS style printsMatthias Clasen2016-01-031-2/+7
| | | | | Add a newline after CSS properties, so things don't run into each other.
* Redo CSS style printingMatthias Clasen2016-01-031-85/+2
| | | | | | | | | | | Drop the custom style printing implementation in gtkcssnode.c and instead reuse the existing gtk_css_style_print function, extending it a bit to suit our needs. Instead of computing values, just recognize initial values by having no CSS section. Also do away with the show-initial flag, and just always filter out initial values. The flag can come back when it is needed.
* Move node printing to GtkCssNodeDeclarationMatthias Clasen2016-01-031-82/+9
| | | | | | | 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.
* cssnode: fix a compiler warningCosimo Cecchi2016-01-031-1/+1
|
* Add a function to dump CSS nodes and stylesMatthias Clasen2016-01-031-1/+189
| | | | | | | | 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.
* css node: Use g_set_objectMatthias Clasen2015-12-181-4/+2
| | | | Replace unref + assignment + ref combinations by g_set_object_calls.
* cssnode: Redo first/last-child change trackingBenjamin Otte2015-12-161-10/+62
| | | | | | | | | | | Invisible nodes don't change the first/last-child status of the nodes after/before them. That means we don't have to just check the state of the adjacent node when modifying this state, but all their siblings until we hit a visible node. The same way, a node is not the first child if it has no previous sibling, it is the first child if it has no previous visible sibling. This is important for caching in the global lookup cache.
* css node: Warn moreMatthias Clasen2015-12-151-0/+2
| | | | | | | gtk_css_node_insert_before/after can easily create cycles which later lead to stack overflows. Even if we're not catching all cycles here, at least we can detect obviously invalid arguments, such as inserting a node next to itself.
* cssnode: Clear cache if reusing styleBenjamin Otte2015-12-151-0/+6
| | | | | | When we reuse styles that didn't change across changes to the source CSS, make sure we clear the caches. Otherwise child nodes will pick up styles from the old source CSS.
* cssnode: Set new style if it's animatedBenjamin Otte2015-12-131-1/+10
| | | | | | | | | | In commit 2c613166771ea9118ebda91c311f11b3462330fb we avoided emitting the style-changed signal if no CSS property changed. Unfortunately, this also caused CSS styles to not be updated when animations started if those animations did not change any CSS value immediately. In those cases the animation would just never start. The obvious example was the spinner.
* cssnode: Catch case where a style didn't changeBenjamin Otte2015-12-121-2/+5
| | | | | | | | Catch the case where a CSS style did not change and don't emit the style-changed signal in that case. This saves not only the emission of the signal, but also doesn't cause invalidation in child nodes, which would previously get a PARENT_STYLE
* cssnode: Change style-changed signalBenjamin Otte2015-12-121-11/+20
| | | | | | | | Instead of having old and new style, now have a GtkCssStyleChange opaque object that will compute the changes you are interested in for you. This simplifies change signal handlers quite a bit and avoids lots of repeated computation in every signal handler.
* css node: Some more docsMatthias Clasen2015-12-061-5/+28
|
* Add more CSS node docsMatthias Clasen2015-11-191-0/+5
|
* Trivial: Some doc rewordingMatthias Clasen2015-11-191-11/+12
|
* Add some CSS node docsMatthias Clasen2015-11-191-0/+36
| | | | | Write up some of the insights from doing the CSS node transition, so the knowledge is not lost.
* cssnode: Propagate NTH_LAST_CHILD changes properlyBenjamin Otte2015-11-091-2/+5
| | | | | | We were just catching the previous sibling before. Now we properly invalidate all previous siblings (and also all other wiblings, but we can think about optimizing that later).
* cssnode: Fix style updating when the CSS node ID changesColomban Wendling2015-11-011-1/+1
| | | | | | | | Since 4ebb5781eaf332da3f8ce5ffb5ecc8668a56f118 ID has a specific value, while it used to be the same as NAME. Thus, explicitly list ID as a radical change just like NAME. https://bugzilla.gnome.org/show_bug.cgi?id=757397
* cssnode: Fix a typo leading to very poor cache hashingColomban Wendling2015-11-011-1/+1
|
* Add some api annotationsMatthias Clasen2015-10-261-3/+3
| | | | | Nothing is using the /*interned*/ annotations currently, but if we are doing this, we should be consistent.
* API: cssselector: Stop supporting regionsBenjamin Otte2015-10-221-4/+2
| | | | | The namespace that belonged to regions is supposed to be used for CssNode names.
* switch: Port to GtkCssNodeBenjamin Otte2015-10-221-0/+6
| | | | | This is a simple port, no code modifications so far other than replacing gtk_style_context_save() with gtk_style_context_save_to_node().
* cssnode: Add setters/getters for nameBenjamin Otte2015-10-221-0/+34
|
* Use g_object_get_qdata instead of g_object_get_dataMatthias Clasen2015-09-121-3/+10
| | | | This is less expensive.
* css node: Avoid a duplicate type checkMatthias Clasen2015-09-121-1/+1
|
* cssnode: Move clear_classes() into the NodeDeclarationBenjamin Otte2015-09-121-7/+3
| | | | | | 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.
* cssnode: Optimize listing of classesGarrett Regier2015-09-111-22/+20
| | | | | | Avoid creating the GList of strings when the GQuarks will just be determined again. Instead have gtk_style_context_list_classes() do it specifically.
* Clean up debug featuresMatthias Clasen2015-09-091-1/+3
| | | | | Introduce a GTK_DEBUG_CHECK() macro and use it to check for GTK_DEBUG flags everywhere. Also guard all such places by
* cssnode: Loosen requirements for style cachingBenjamin Otte2015-08-271-6/+39
| | | | | | | | We can actually share :first-child/:last-child related things now, because we special case them. So the only positions we cannot cache are nth-child/nth-last-child. This should take care of a lot of Adwaita's styling.
* cssnode: Add gtk_css_node_reverse_children()Benjamin Otte2015-07-161-0/+15
|
* cssnode: Change API of some functionsBenjamin Otte2015-07-161-9/+17
| | | | | | | | gtk_css_node_set_after/before() are now called gtk_css_node_insert_after/before(). This brings them in line with other similar APIs (ie GtkListStore). And it allows easier usage of the API (see changes to gtkbox.c).
* cssnode: Only queue_validate() when node is visibleBenjamin Otte2015-07-101-9/+28
| | | | This avoids running animations in hidden toplevels.
* cssnode: Only invalidate sibling nodes if changed node is visibleBenjamin Otte2015-07-101-10/+25
|
* cssnode: Do finer-grained position invalidationBenjamin Otte2015-07-061-5/+26
| | | | | | As a side effect, this should fix this bug: https://bugzilla.gnome.org/show_bug.cgi?id=751910
* cssnode: Fix position invalidationBenjamin Otte2015-05-301-24/+7
| | | | The previous code was overly complicated and wrong.
* cssnode: Add propertiesBenjamin Otte2015-03-181-5/+196
|
* cssnode: Add a style-changed signalBenjamin Otte2015-03-181-8/+23
| | | | The signal gets emitted whenever the style needs to be changed.
* cssnode: Add node-added and node-removed signalBenjamin Otte2015-03-181-56/+100
| | | | | | This allows monitoring the CSS tree. For now, moving a child to a different position relative to its siblings while keeping the same parent will cause a child-added + child-removed emission.
* cssnode: Track invalid childrenBenjamin Otte2015-03-181-11/+25
| | | | | | We need to properly track if a node needs to propagate invalidation state information to its children. We didn't do this properly before and that could lead to us forgetting to invalidate nodes in corner cases.
* cssnode: Change the way we invalidate timestampsBenjamin Otte2015-03-181-4/+21
| | | | | | | | Do not propagate the TIMESTAMP change through the node tree, as that causes lots of uneeded markings of nodes as invalid. Instead, walk the node tree and find the nodes that have a non-static style and only invalidate timestamps on those.
* cssstyle: Add gtk_css_style_is_static()Benjamin Otte2015-03-181-4/+2
| | | | | | | Gets rid of the need to do if (ANIMATED_STYLE() && animated_style_is_static(ANIMATED_STYLE(style))
* cssnode: Special-case TIMESTAMP invalidationsBenjamin Otte2015-03-181-0/+6
| | | | | | | | | Only invalidate timestamps if the node is marked as invalid. We overload the meaning of "invalid" as "tracks timestamps". While I don't like the way this is written, it is an important optimization because 95+% of nodes don't animate so timestamps don't matter to them. But timestamps are invalidated 60x per second.
* cssnode: Redo style changed trackingBenjamin Otte2015-03-181-10/+10
| | | | | | | | | We don't return a NULL style to mean "no changes" anymore, instead we check new_style == old_style to mean that. Make sure the code reflects this, otherwise we'll send GTK_CSS_CHANGE_PARENT_STYLE invalidations everywhere and screw up performance.
* stylecontext: Call get_style(), not create_style()Benjamin Otte2015-03-181-1/+1
| | | | | | We want to ensure that the style is created properly. This also allows making the create_Style() function private.
* cssnode: Merge the 2 places that compute stylesBenjamin Otte2015-03-181-26/+11
| | | | | | Now that the widget node recomputes styles on update_style() we can just call it during validate(). That way, we don't need the widget node to manually compute its style.