| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
GtkCssLocation is a type so it should be prefixed with # rather than @.
|
|
|
|
|
|
| |
We only every parse one of those at a time, so keep a GString around for
it. This way we don't have to create a new GString every time we parse
an identifier. Doesn't spare us the strdup though.
|
|
|
|
|
|
| |
Using a variadic function is just awkward there. Use different init
functions and use them as appropriate; we already know which one to call
everywhere.
|
|\
| |
| |
| |
| | |
types: fix various use of volatile in type registration
See merge request GNOME/gtk!2865
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The use of volatile was incorrect in GLib and has been that way for
a long time. Recently however that has changed, and this makes GTK
follow suit to avoid using volatile in the type registration.
See also: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
Combined with the above merge request for GLib, this fixes a large
number of compilation warnings when using Clang.
|
| | |
|
|/
|
|
|
| |
We only need hardening linker flags on the libgtk shared library;
internal static libraries don't really need them.
|
|
|
|
|
|
|
| |
It doesn't make much sense to set this in per-directory
meson files, since that makes use use different logging
facilities in different parts of the project. Set it
globally.
|
|
|
|
|
| |
A CDO is 4 characters: <!--, not 3 as our tokenizer
was pretending.
|
|
|
|
|
|
| |
Rename _gtk_css_print_string to strip the _ and add
an insert_newlines argument to it. Update all callers,
and make the render node serializer insert newlines.
|
|
|
|
|
|
| |
Move this to a separate header, since it is not
parser functionality, and kill the duplicate
gtkcssparserprivate.h header.
|
|
|
|
|
| |
This lets us use it from the render node parser
in gsk.
|
|
|
|
|
|
|
|
|
| |
The parser got its chars mixed up while parsing numbers
like 2.3e-04. While it is unlikely to meet such numbers
in human-generated css, we do have them e.g. when saving
render node trees with transforms.
Also add some css parser tests for number parsing.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
gtk-doc was complaining about it missing,
and it is used in some ifdefed code.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The testusite failures explain why:
We don't want to print "1.00000000000000000", but "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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This surprisingly decodes data URLs.
|
|
|
|
| |
Testcases included.
|
|
|
|
|
|
| |
Otherwise we infinitely end up with the error again.
Testcases added.
|
| |
|
|
|
|
|
|
| |
Necessary when the header file is included in C++ code.
Merge request !773
|
|
|
|
|
| |
... and use them to report better error locations for the warning when
blocks aren't terminated properly.
|
| |
|
|
|
|
|
| |
And for the quick function, use the start/end location of the current
token.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
1. Export multiple locations
2. Return the location instead of passing one in
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
So far that parser is unused.
|
|
|
|
| |
And make the struct public, so we can use it in signal handlers.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This is copied from an old branch of mine.
|
|
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).
|