Commit Graph

47051 Commits

Author SHA1 Message Date
Benjamin Otte
2e05b896de css: Add token parser for bgsize values 2016-04-08 16:18:29 +02:00
Benjamin Otte
c767617d54 css: Add token parse for position values
And implement that parser completely. Now that we have calc(), this
actually works.
2016-04-08 16:18:29 +02:00
Benjamin Otte
90e423b34d css: Consume whitespace tokens automatically
Exception: The selector parsing code uses the peek_token() vfunc to
actually get the real tokens, whitepsace included.
2016-04-08 16:18:27 +02:00
Benjamin Otte
d7c8885852 css: Add token parsers for shadows
This also introduces the new idea of check_token() functions. These
functions check if a given function might be the initial token in
parsing a certain value. Implementations for numbers and colors are
included.
2016-04-08 16:18:07 +02:00
Benjamin Otte
567d9887f7 css: A token parse func for repeat values 2016-04-08 16:18:07 +02:00
Benjamin Otte
32d671cfd7 inspector: Move errors on EOF token to last token
That's wrong, but it makes sure we don't lose any error messages.
2016-04-08 16:18:07 +02:00
Benjamin Otte
fae4a14177 css: Add token parser for ease values
Also add a parser for functions to the token source.
2016-04-08 16:18:07 +02:00
Benjamin Otte
c0ee099aa1 css: Add a token parser for border values 2016-04-08 16:18:07 +02:00
Benjamin Otte
ab402e2400 css: Add token parser for corner radius value 2016-04-08 16:18:07 +02:00
Benjamin Otte
c5d5825cf0 css: Add token parser for palettes 2016-04-08 16:18:07 +02:00
Benjamin Otte
6c72e9423f css: add token parser for icontheme values 2016-04-08 16:18:07 +02:00
Benjamin Otte
73d69e353b css: Add token parser for array values 2016-04-08 16:18:07 +02:00
Benjamin Otte
e9bc9082a4 css: Convert enums to token parsing 2016-04-08 16:18:07 +02:00
Benjamin Otte
b9c77aadec css: Add token parsing for number values
This includes calc() and the win32 number values.

CSS properties using just <length>, <angle>, <time>, <percentage> or
<number> have been converted.
2016-04-08 16:18:05 +02:00
Benjamin Otte
974ca283ef css: Change the way we token parse longhands
- Move the default parse func to gtkcssstylepropertyimpl.c and use it
  there.
- Change the arguments in the prototype of the parse func so that we
  don't use trampolines anymore.
- Stop using a trampoline for color parsing.
2016-04-08 16:17:22 +02:00
Benjamin Otte
0a11e4d36b css: Add token parsing for colors
... and add infrastructure to use it to longhand properties.
2016-04-08 16:17:22 +02:00
Benjamin Otte
662065bdb1 css: Allow the css editor to take a CSS node
Use that to hilight the selectors that match that node.
2016-04-08 16:17:22 +02:00
Benjamin Otte
9c02a600b2 css: Add gtk_style_property_token_parse()
Slowly move the token parser into CSS value parsing.
2016-04-08 16:17:22 +02:00
Benjamin Otte
257273c439 inspector: Add style sheet parsing to CSS editor
This way, we can now keep backlogs to the style sheet objects from the
tokens. A simple use of that is included via syntax hilighting of CSS
properties.

Also, we now take the errors from the style sheet parsing and not from
the loading of the CSS provider. This is a bit of a regression for now,
as the style sheet parser does not emit very many errors yet.
2016-04-08 16:17:22 +02:00
Benjamin Otte
348052064a cssdeclaration: Store the style property
That way, we can error if a property name isn't valid.
2016-04-08 16:17:22 +02:00
Benjamin Otte
14e7c42200 css: Add a consumer object to consume_token()
This is to allow backreferences from code analysis frameworks.
2016-04-08 16:17:22 +02:00
Benjamin Otte
e64a143ff7 tokenizer: Emit token in error vfunc 2016-04-08 16:17:22 +02:00
Benjamin Otte
840d347d59 css: Add code to parse declarations
We don't parse the values yet.
2016-04-08 16:17:22 +02:00
Benjamin Otte
674ca8ae1c css: Add skeleton for new parsing infrastructure
This infrastructure will be based around the CSSOM and return a
GtkCssStyleSheet object as its result.

The initial intended use for this is as a syntax tree while editing in
the inspector, but we might even want to look into exporting the CSSOM
parts as public API at some point.
2016-04-08 16:17:21 +02:00
Benjamin Otte
25b2e2f3e5 inspector: Implement rudimentary syntax hilighting
We hilight comments in blue and strings in red. Go us!
2016-04-08 16:17:21 +02:00
Benjamin Otte
48b241833a inspector: Don't clear all tags when getting text 2016-04-08 16:17:21 +02:00
Benjamin Otte
460ad90379 gtk: Add an RB tree implementation for use in CSS code
Some tests included
2016-04-08 16:17:21 +02:00
Benjamin Otte
adeec6656c rbtree: Remove unused typedef 2016-04-08 16:17:21 +02:00
Benjamin Otte
78fd100ade css: Add GtkCssTokenizer
So far, it's known to successfully tokenize Adwaita's CSS.
2016-04-08 16:17:21 +02:00
Benjamin Otte
b1a8537314 theme: linear-gradient() needs 2 color-stops
So make sure our _solid() function gives it two.
2016-04-08 16:17:21 +02:00
Benjamin Otte
7a69ea89ca theme: Add _solid() function
The function creates a solid color image. Currently this is done with
linear-gradient().
2016-04-08 16:17:14 +02:00
Benjamin Otte
41195f6300 switch: An active switch is :checked
Fix an oversight that should have happened in the gadget refactoring:
An active switch should be :checked, just like togglebuttons,
checkbuttons, etc.
2016-03-23 18:14:57 +01:00
Christoph Reiter
3f077ec36f quartz: fix pixelated image surfaces in retina/hidpi mode
gtk+ currently depends on the scaling factor and the cairo device scale
of both the backend surfaces and image surfaces to be equal.

Until now we didn't apply a cairo device scale at all and depended on the
automatic scaling of CGContexts. This works when drawing with cairo but
fails in case of image surfaces, which get requested at a too small size.

To make the quartz backend behave more like the X11 one, set the cairo device
scale on the surface in gdk_quartz_ref_cairo_surface(). As this conflicts
with the default scaling done by CGContext (we would get double scaling)
undo the CGContext scaling using CGContextScaleCTM().

This patch is based on the following patches by Brion Vibber:
    https://bugzilla.gnome.org/show_bug.cgi?id=740199#c4
    https://bugs.freedesktop.org/show_bug.cgi?id=69796#c4

https://bugzilla.gnome.org/show_bug.cgi?id=763779
2016-03-23 16:27:10 +01:00
Stas Solovey
3a5848820c Updated Russian translation 2016-03-23 15:23:08 +00:00
Fran Dieguez
1355f00825 Updated Galician translation 2016-03-23 11:20:59 +00:00
Matej Urbančič
0ab7be8d57 Updated Slovenian translation 2016-03-22 22:28:03 +01:00
Stas Solovey
aac8b0120f Updated Russian translation 2016-03-22 20:19:44 +00:00
Matthias Clasen
d6ca66b712 Run a11y tests with csd for make check
I've made this change for installed tests a while ago. It doesn't
make sense for distcheck to do it differently.
2016-03-22 14:55:55 -04:00
Matthias Clasen
65927caf84 inspector: Look for themes in system data dirs
This matches what GTK+ does now.
2016-03-22 08:22:48 -04:00
Matthias Clasen
052e82db04 Fix an accidentally deleted line
Not sure when this went missing, just fix the formatting.
2016-03-22 08:22:48 -04:00
Daniel Mustieles
f46aad3a32 Updated Spanish translation 2016-03-22 11:28:57 +00:00
Dušan Kazik
4173360bb3 Updated Slovak translation 2016-03-22 06:35:00 +00:00
Zahari Yurukov
3e375a6c81 Added Bulgarian translation 2016-03-22 07:19:04 +02:00
Matthias Clasen
7cb36aba40 Load theme settings from the right location
When loading a per-theme settings.ini file, look for it in
the same directory where we found the gtk.css file for the
theme. Previously, we were always looking in
$prefix/share/themes/THEME/gtk-3.0/, even if the css was
loaded from somewhere else.

https://bugzilla.gnome.org/show_bug.cgi?id=641354
2016-03-21 22:19:19 -04:00
Matthias Clasen
475d916eb9 Also look in system data dirs for themes
With this change, we now look in
$XDG_DATA_HOME/themes/THEME/gtk-3.x
$HOME/.themes/THEME/gtk-3.x
$XDG_DATA_DIRS/themes/THEME/gtk-3.x
GTK_DATA_PREFIX/themes/THEME/gtk-3.x

https://bugzilla.gnome.org/show_bug.cgi?id=641354
2016-03-21 22:19:19 -04:00
Christian Hergert
c48bc48dda wayland: avoid dropping surfaces when possible
If the configure-event gives us the same size as we had before,
which is common for animation resizes, then try to keep the
existing buffer around. This saves us a memfd_create() syscall
on every frame.

https://bugzilla.gnome.org/show_bug.cgi?id=763350
2016-03-21 22:03:20 -04:00
Ask Hjorth Larsen
7c2f81bcd9 Updated Danish translation 2016-03-21 22:20:26 +01:00
Lapo Calamandrei
ee94f9ff89 Adwaita: simplify treeview:drop(active) code 2016-03-21 19:42:54 +01:00
Matthias Clasen
73fe852be0 gtk-demo: Improve markup demo
Add squiggly underlines and background, and make the markup editable.

https://bugzilla.gnome.org/show_bug.cgi?id=763741
2016-03-21 13:32:40 -04:00
Benjamin Otte
45dfdbce3f textview: Track differences between ink and logical rects
This way, we can ensure that we queue redraws on the full ink rect. This
is particularly visible for squiggly underlines in spell checking.

https://bugzilla.gnome.org/show_bug.cgi?id=763741
2016-03-21 13:26:57 -04:00