Commit Graph

80287 Commits

Author SHA1 Message Date
Matthias Clasen
ad220e77b5 css: Speed up parsing without variables
Do a cheesy upfront strstr to find out if there's any var( at all.
If not, we don't need to consult the parser to find out if a
property value has references.
2024-05-20 15:20:23 -04:00
Matthias Clasen
dee2150a04 css: Speed up checking for var()
gtk_css_parser_has_references is meant to be a quick check for
whether a property value contains a variable reference, it just
returns a boolean and doesn't need to report any errors, so lets
not parse the property value any more than we need to.
2024-05-20 13:56:52 -04:00
Matthias Clasen
2aeb80f490 Merge branch 'ccs-math' into 'main'
css: Implement math functions

See merge request GNOME/gtk!7249
2024-05-20 14:40:48 +00:00
Matthias Clasen
8a2f434443 Merge branch 'css-animation-optimization' into 'main'
css: Less recomputation in animation

See merge request GNOME/gtk!7263
2024-05-20 14:26:18 +00:00
Matthias Clasen
d4134430fc Merge branch 'matthiasc/for-main' into 'main'
css: Avoid a possible memory leak

See merge request GNOME/gtk!7272
2024-05-20 13:49:53 +00:00
Matthias Clasen
73f64971c8 css: Avoid a possible memory leak
Currently, style->variables is always NULL when we get here, but
better to be safe than sorry, and clear the fields before we
overwrite it.
2024-05-20 08:57:28 -04:00
Matthias Clasen
ecc2c953e5 css: Avoid more recomputation
Pass a reason into gtk_css_animated_style_recompute, and avoid
recomputing properties that aren't affected. The possible reasons
for now are that variables of color changes. Better tracking
for currentColor in properties will allow us to improve this
later.
2024-05-20 08:48:20 -04:00
Matthias Clasen
e353117937 css: Make animation recomputation more efficient
Use the same shorthand-keeping trick we do when computing
static styles.
2024-05-20 08:27:47 -04:00
Matthias Clasen
492ae6df35 css: Less recomputation in animation
Only recompute the animated style once all the custom variables
have been updated.
2024-05-20 08:27:47 -04:00
Matthias Clasen
a19d0471e9 Merge branch 'css-var-syntax-errors' into 'main'
css: Report some var() syntax errors

See merge request GNOME/gtk!7264
2024-05-20 12:21:18 +00:00
Matthias Clasen
5b5ba36999 Merge branch 'matthiasc/for-main' into 'main'
css: Add some more variables tests

See merge request GNOME/gtk!7268
2024-05-20 10:21:21 +00:00
Balázs Úr
89b64cbf47 Update Hungarian translation 2024-05-19 23:47:50 +00:00
Matthias Clasen
e65d1f2122 Cosmetics 2024-05-19 18:57:24 -04:00
Matthias Clasen
2756496d47 css: Cosmetics
Don't set the same field twice.
2024-05-19 18:04:20 -04:00
Matthias Clasen
8b653f21cc Drop more underscores
Drop the remaining _'s from css number value apis.
2024-05-19 17:27:37 -04:00
Matthias Clasen
4e6759a126 css: Implement math functions
Implement the functions described in the "Mathematical
Expressions" section of the "CSS Values and Units Module
Level 4" spec, https://www.w3.org/TR/css-values-4/.

Beyond calc(), which we already had, this includes
min(), max(), clamp(),
round(), rem(), mod(),
sin(), cos(), tan(), asin(), acos(), atan(), atan2(),
pow(), sqrt(), hypot(), log(), exp(),
abs(), sign(),
e, pi, infinity and NaN.

Some tests included.
2024-05-19 17:27:37 -04:00
Matthias Clasen
d20e0b0370 Merge branch 'gtk-4-macos-dock-quit' into 'main'
[GTK 4] macOS: Dock "Quit" invokes "app.quit" action

See merge request GNOME/gtk!7265
2024-05-19 21:06:11 +00:00
Matthias Clasen
f5d69fa0c5 css: Add some more variables tests
Add a test mixing color expressions with variables, and
empty fallback values.
2024-05-19 16:39:02 -04:00
Thomas Holder
f191fc0047 macOS: Dock "Quit" invokes "app.quit" action
Allows the application to handle "Dock icon > Quit" the same as
"Application menu > Quit".

Requires GtkApplication's `register-session` property.

Suitable replacement for gtk-mac-integration's
`NSApplicationBlockTermination` signal.
2024-05-19 23:10:31 +03:00
Matthias Clasen
b60c60f03b css: Report some var() syntax errors
Detect cases such as var(), var(-), var("a") or var(21) early
and report them as syntax errors.

Test included.

Related: #6715
2024-05-19 15:56:26 -04:00
Matthias Clasen
af0c277bba Merge branch 'matthiasc/for-main' into 'main'
css: Lose more underscores

See merge request GNOME/gtk!7261
2024-05-19 05:14:05 +00:00
Matthias Clasen
970c9eef63 css: Use an anonymous union for color values
We already do this for number values, and it looks less messy.
2024-05-18 09:23:40 -04:00
Matthias Clasen
2439876bd3 css: Simplify color resolving a bit
We know the initial value of the color property, no need to
resolve it again.
2024-05-18 09:09:21 -04:00
Matthias Clasen
97582ae9ad css: Simplify color resolving
The cycle argument is purely a detail of the internal implementation,
no need to have it in the api.
2024-05-18 09:03:57 -04:00
Matthias Clasen
a5b85f0dc5 css: Lose more underscores
Drop the _ from the color value apis. Update all callers.
2024-05-18 08:59:24 -04:00
Matthias Clasen
aefb16510b Merge branch 'css-fiddling' into 'main'
css: Lose some underscores

See merge request GNOME/gtk!7255
2024-05-16 01:49:52 +00:00
Benjamin Otte
4360d433b5 Merge branch 'wip/otte/for-main' into 'main'
columnview: Actually check the listview in return_if_fail()

See merge request GNOME/gtk!7254
2024-05-16 01:30:20 +00:00
Matthias Clasen
5927319589 css: Inline a few functions
These are just operating on the value base and can easily be inlined.
2024-05-15 20:54:45 -04:00
Matthias Clasen
25db645f65 css: Lose some underscores
Drop the _ from all the gtk_css_value apis.
2024-05-15 20:54:43 -04:00
Benjamin Otte
b3c6a98132 vulkan: Add a missing extension
We need to enable this one, too.

Thanks validation layers!
2024-05-16 02:24:17 +02:00
Benjamin Otte
031109aec3 columnview: Actually check the listview in return_if_fail()
This was missed when adding return_if_fail()s in
172cdf8e21.

Related: !7240
2024-05-16 02:24:17 +02:00
Jordi Mas i Hernandez
18d2f9c8a4 Update Catalan translation
(cherry picked from commit 27d75be15e)
2024-05-15 19:53:58 +00:00
Jordi Mas i Hernandez
0ae721f144 Update Catalan translation
(cherry picked from commit 8ccc36c389)
2024-05-15 18:02:53 +00:00
Matthias Clasen
7898d1b46d Merge branch 'wip/sophie-h/print' into 'main'
printdialog: Fix some annotiations

Closes #6709

See merge request GNOME/gtk!7251
2024-05-14 20:51:54 +00:00
Sophie Herold
3648398f6d printsetup: Remove nullable from settings getters
GtkPrintSetup is initialized with the values returned from the portal.
Therefore the page setup and the print settings can never be NULL.
2024-05-14 22:21:19 +02:00
Sophie Herold
019916c5b9 printdialog: Remove nullable for GError functions
Functions that set a GError should not be marked as nullable if they
only return NULL on error.
2024-05-14 22:12:04 +02:00
Sophie Herold
ebb31590ae printdialog: Add missing nullable to getters
The initial values are NULL.
2024-05-14 22:10:29 +02:00
Benjamin Otte
32ea1cf32d Merge branch 'wip/kabus/scroll_to_null_tile' into 'main'
listbase: Fix a null dereference

See merge request GNOME/gtk!7240
2024-05-14 19:48:42 +00:00
Khalid Abu Shawarib
172cdf8e21 listbase: Return early on non-existent scroll position 2024-05-14 15:27:38 +03:00
Matthias Clasen
dc07bcf3a3 Merge branch 'michaelweghorn/a11y_atspi_map_level_property' into 'main'
a11y atspi: Map GTK_ACCESSIBLE_PROPERTY_LEVEL to AT-SPI attr

See merge request GNOME/gtk!6549
2024-05-13 16:02:53 +00:00
Matthias Clasen
bd96c10563 Merge branch 'matthiasc/for-main' into 'main'
testsuite: Improve test-css-parser

See merge request GNOME/gtk!7248
2024-05-13 14:57:15 +00:00
Matthias Clasen
76299396cf testsuite: Improve test-css-parser
Make it so that --generate parse produces output that can be
directly pasted into the ref.css file.
2024-05-13 10:04:28 -04:00
Ekaterine Papava
a96dd2ad0a Update Georgian translation 2024-05-13 00:45:14 +00:00
Matthias Clasen
1e210e83bb Merge branch 'structcleanup' into 'main'
gdk: Remove unused struct 'XPointerUngrabInfo'

See merge request GNOME/gtk!7245
2024-05-12 04:52:19 +00:00
Dr. David Alan Gilbert
14f1a91bff gdk: Remove unused struct 'XPointerUngrabInfo'
'XPointerUngrabInfo' appears unused since
commit 26cbf87d7d ("New approach for grab tracking code")
Remove it.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
2024-05-12 01:06:31 +01:00
Matthias Clasen
3f2bcdf82e Merge branch 'matthiasc/for-main' into 'main'
wayland: Tweak cursor sizing code

See merge request GNOME/gtk!7244
2024-05-11 03:40:53 +00:00
Matthias Clasen
c61d8bc188 wayland: Tweak cursor sizing code
We want to take advantage of a viewporter also for named cursors.
2024-05-10 23:10:50 -04:00
Matthias Clasen
4e5976427b NEWS: Updates 2024-05-10 21:47:44 -04:00
Matthias Clasen
7fcdb0205f Merge branch 'wip/alice/css-variables' into 'main'
CSS custom properties/variables

See merge request GNOME/gtk!6540
2024-05-11 01:38:10 +00:00
Benjamin Otte
4814c5f653 array: Don't overflow array size
Copy what gcc's libstdc++ does for vectors to avoid overflows:

1. Define a max size macro and assert against it
   Note that we don't assert but actually check, because this needs
   to abort even if assertions are disabled.
2. Don't do fancy math to compute new capacity.
   Just size *= 2 instead and be careful about overflow.
2024-05-10 21:22:03 -04:00