summaryrefslogtreecommitdiff
path: root/gtk/css
Commit message (Collapse)AuthorAgeFilesLines
* Replace fallthrough comments with G_GNUC_FALLTHROUGHTimm Bäder2020-03-061-2/+2
|
* Add pure and const annotations to various functionsTimm Bäder2020-01-261-5/+5
|
* cssparser: make a few local variables constTimm Bäder2020-01-261-3/+3
|
* Use a single compilation symbolEmmanuele Bassi2019-11-275-5/+5
| | | | | | | | | | | | We use a compilation symbol in our build to allow the inclusion of specific headers while building GTK, to avoid the need to include only the global header. Each namespace has its own compilation symbol because we used to have different libraries, and strict symbol visibility between libraries; now that we have a single library, and we can use private symbols across namespaces while building GTK, we should have a single compilation symbol, and simplify the build rules.
* csstokenizer: Plug a leakTimm Bäder2019-11-191-2/+3
|
* css: Fix some doc typosMatthias Clasen2019-06-221-2/+2
|
* Add GTK_CSS_PARSER_WARNING_UNIMPLEMENTEDMatthias Clasen2019-06-221-1/+2
| | | | | gtk-doc was complaining about it missing, and it is used in some ifdefed code.
* rendernodeparser: Parse cairo scriptBenjamin Otte2019-05-301-0/+2
| | | | | | | | | | | | Use cairo-script-interpreter to parse the scripts that generate cairo nodes. This requires libcairoscriptinterpreter.so to work properly, but if it isn't found we disable this (unimportant for normal functioning) code and just emits a parser warning. The testsuite requires it however or it will fail. A new test is included that tests all of this.
* css: Use %f, not %.17fBenjamin Otte2019-05-291-1/+1
| | | | | The testusite failures explain why: We don't want to print "1.00000000000000000", but "1".
* css: Don't print numbers with exponentBenjamin Otte2019-05-291-1/+1
| | | | | | | | CSS does not do exponents, so printing numbers close to 0 as 1.234e-15 does not work. Also up the accuracy to 17 digits because that's what everyone else uses.
* cssparser: Make gsk_renderer_consume_url() return a stringBenjamin Otte2019-05-122-13/+3
| | | | | | | | | | We don't want to return a GFile because GFile can't handle can't deal with data: urls. That makes the code a bit more complicated that doesn't deal with those URLs, but it makes the other code actually work. GtkCssImageUrl also now decodes data urls immediately instead of only at the first load. So don't use data urls if you care about performance.
* cssparser: Don't allow commit_token() on block EOFBenjamin Otte2019-05-121-2/+12
| | | | | | | | | | | When we're at the end of a block and gtk_css_parser_get_token() returns NULL, gtk_css_parser_commit_token() still consumed the next token. It does not anymore. This does not affect the CSS parser, but it exposes issues with the render parser, which previously just consumed too many closing } tokens in the past.
* css: Add gtk_css_data_url_parse()Benjamin Otte2019-05-123-0/+211
| | | | This surprisingly decodes data URLs.
* csstokenizer: Handle backslash at end of documentBenjamin Otte2019-05-081-17/+25
| | | | Testcases included.
* csstokenizer: Consume the \ when encountering an errorBenjamin Otte2019-05-061-0/+1
| | | | | | Otherwise we infinitely end up with the error again. Testcases added.
* cssparser: Add gtk_css_parser_has_number()Benjamin Otte2019-05-052-0/+10
|
* csserror: Add G_BEGIN_DECLS and G_END_DECLSKjell Ahlstedt2019-04-241-0/+4
| | | | | | Necessary when the header file is included in C++ code. Merge request !773
* cssparser: Add error functions that take locationsBenjamin Otte2019-04-122-2/+63
| | | | | ... and use them to report better error locations for the warning when blocks aren't terminated properly.
* css: Move gtkcsssection.[ch] into gtk/cssBenjamin Otte2019-04-124-0/+329
|
* cssparser: Pass in error locations explicitlyBenjamin Otte2019-04-121-8/+8
| | | | | And for the quick function, use the start/end location of the current token.
* cssprovider: Redo error emissionBenjamin Otte2019-04-122-8/+24
| | | | | | | | Emit all errors via the parser, don't try to have a custom error handling machinery. The only exception is the initial file load error - we need to do that one directly, because there is no parser.
* cssparser: Improve location APIsBenjamin Otte2019-04-122-8/+73
| | | | | 1. Export multiple locations 2. Return the location instead of passing one in
* css: Redo for new parserBenjamin Otte2019-04-122-21/+25
| | | | | | | This commit is still way too big, but I couldn't make it smaller. It transitions the old CSS parser to the new parser. CSS parsing is now tokenized, everything else is probably still buggy.
* Resurrect the CSS parser from the tokenizer branchBenjamin Otte2019-04-124-1/+1116
| | | | So far that parser is unused.
* css: Split GtkCssLocation into its own fileBenjamin Otte2019-04-127-39/+162
| | | | And make the struct public, so we can use it in signal handlers.
* csstokenizer: Add gtk_css_token_is_preserved()Benjamin Otte2019-04-122-0/+79
|
* tokenizer: Pass error arg to read_token()Benjamin Otte2019-04-122-386/+322
| | | | | | Instead of an error vfunc, have the tokenizer vfunc take a GError argument. Note that even when an error is returned, there is still a token to be read.
* css: Add GtkCssTokenizerBenjamin Otte2019-04-123-0/+1597
| | | | This is copied from an old branch of mine.
* build: Add gtk-css static libraryBenjamin Otte2019-04-127-0/+313
This library is meant to be the new CSS library that gets used from GDK, GSK and GTK for string printing and parsing. As a first step, move GtkCssProviderError into it. While doing so, split it into GtkCssParserError (for critical problems) and GtkCssParserWarning (for non-critical problems).