Commit Graph

80 Commits

Author SHA1 Message Date
Matthias Clasen
d0a675ab01 gsk: Add subsurface nodes
Also show them in the inspector recorder, with some information.
2023-11-13 22:17:35 +01:00
Benjamin Otte
76007c4d09 rendernode-tool: Add --undecorated to show command
This is to get exactly just the rendernode drawn when testing, and not
any extra drawing code.
2023-10-31 00:36:27 +01:00
Matthias Clasen
c721c4d6ef path-tool: Fix the restrict command 2023-09-21 15:36:25 -04:00
Benjamin Otte
24048dce43 render-node-tool: Actually load files properly 2023-09-15 16:34:00 +02:00
Benjamin Otte
9dfdb1b65b rendernode-tool: Fix array size
Also add an assertion, so things explode properly if we forget to
update the array size when adding new nodes, instead of writing random
memory.
2023-09-07 16:19:20 +02:00
Matthias Clasen
1e8e7e0c00 path-tool: Make render match show 2023-09-03 23:47:10 +02:00
Matthias Clasen
1e9e8d24c3 path-tool: Add a --point-color option 2023-09-03 23:47:10 +02:00
Matthias Clasen
061a56d213 path-tool: Add a way to show controls 2023-08-31 03:19:25 -04:00
Matthias Clasen
3f63ba36ce path-tool: Factor out dash parsing
No need to do this in two places.
2023-08-31 03:19:17 -04:00
Matthias Clasen
dcbca3f0d7 path-tool: Add a reverse command
It does what it says.
2023-08-28 00:27:29 -04:00
Matthias Clasen
81c8d1dd28 path-tool: Add length to info output
This requires GskPathMeasure.
2023-08-25 22:26:54 -04:00
Matthias Clasen
32d00ca9ed path-tool: Add a restrict command
This lets you subset a path between two given lengths.
2023-08-25 22:26:54 -04:00
Matthias Clasen
25e6231a88 path: Switch back to conics
Arcs were appealing, but they have a fatal flaw: we can't
split our arcs without changing the ellipse they trace.
That could be fixed by adding an extra parameter, but then
it is no longer any better than conics.

So switch back to conics, which have the advantage that they
are used elsewhere.
2023-08-25 07:33:16 -04:00
Matthias Clasen
d33ed4f9ab path: Add elliptical arcs
Add a new curve type for elliptical arcs
and use it for rounded rectangles and circles.
We use the 'E' command to represent elliptical
arcs in serialized paths.
2023-08-23 12:43:52 -04:00
Matthias Clasen
79e132ab7b path-tool: Reorganize options
Put fill and stroke options into their own group.
This helps produce understandable --help output.
2023-08-22 09:56:43 -04:00
Matthias Clasen
03a511aab4 path-tool: Make info show statistics
It is somewhat interesting to know how many
contours, lines, etc. a path consists of.
2023-08-15 13:33:23 -04:00
Matthias Clasen
62176a3bd0 tools: Add gtk4-path-tool
This comes in handy for testing, among other things.

For now, this supports decomposing, reversing, rendering,
info and preview.
2023-08-12 16:34:19 -04:00
Benjamin Otte
3aa3816125 gsk: Add GskStrokeNode
Take a rendernode as source and a GskPath and GskStroke,
and fill the area that is covered when stroking the path
with the given stroke parameters, like cairo_stroke() would.
2023-08-07 13:02:57 -04:00
Benjamin Otte
fc4a464b47 gsk: Add GskFillNode
Take a rendernode as source and a GskPath and fill
the region inside the path with the source, just like
cairo_fill() would.
2023-08-06 21:01:11 -04:00
Benjamin Otte
3f16f7e0d4 rendernode-tool: Add another magic format
Make .svg use the Cairo renderer to save to an SVG file.

It's useful when comparing rendering behavior and times with
web browsers (as long as one is aware that browsers build a full
DOM tree out of those SVGs).
2023-07-31 16:51:03 +02:00
Benjamin Otte
166777dd55 rendernode-tool: Move code
No functional changes yet.
2023-07-31 16:51:03 +02:00
Benjamin Otte
1f848bf9fd rendernode-tool: Save to tiff
If the save filename ends in .tiff, save to tiff instead.

For now this is a sneaky autodetect feature, not sure if/how to make it
more explicit.
2023-07-28 09:06:14 +03:00
Benjamin Otte
1e75fc35c8 tools: No need for --force when specifying filename
If people specify the filename, they should know what they're doing.

If they don't, abort if the guessed filename already exists and insist
on the user explicitly giving it.
2023-07-22 23:30:15 +02:00
Daniel Boles
8da96b9353 tools: Replace references to GTK+ with GTK no plus 2023-07-21 12:05:25 +01:00
Matthias Clasen
601011ccc0 Add a gtk4-rendernode-tool
This is meant to work with serialized render nodes.
2023-07-21 06:26:11 -04:00
Matthias Clasen
411e0c5fbd tools: Use #pragma once
We are trying to be consistent about this.
2023-07-20 15:18:13 -04:00
Matthias Clasen
e523d3a50e tools: Drop unnecessary conditionals
We require GLib 2.76 now.
2023-07-20 15:18:13 -04:00
Matthias Clasen
ab809d1dc3 buildertool: Exit orderly
The validate command does need a display connection,
for better or worse. So exit in an orderly fashion
if we don't have one, instead of crashing.

Fixes: #5948
2023-07-12 15:49:11 -04:00
Chun-wei Fan
6d1537647c tools/generate-uac-manifest.py: Fix formatting
As this script is now also used in GLib, unify the formatting between
GLib and GTK. Make the formatting of the script conformant to the
Black[1] tool, as GLib requires, and add a copyright header to this
script.

[1]: https://black.readthedocs.io/en/stable/, see also
$(glibsrcroot)/.gitlab-ci/run-bash.sh
2023-07-03 12:50:55 +08:00
Matthias Clasen
723fb6c8be gtk4-builder-tool: Fix naming
We install the tool as gtk4-builder-tool, so that
is what it should call itself.

String change.
2023-06-27 07:09:04 -04:00
Matthias Clasen
33fc4d6495 buildertool: Make render an alias for screenshot
Its a more neutral name and will align better with
other tools.
2023-06-26 10:58:35 -04:00
Matthias Clasen
c2ba1d69a1 Rename pixbuf utils to texture utils
That is what this is now.
2023-05-16 22:00:08 -04:00
Matthias Clasen
847739aed7 Reduce pixbuf helpers
Concentrate pixbuf handling in gdkpixbufutils.c.
2023-05-16 21:56:22 -04:00
Matthias Clasen
9463e0f56c Only build iconcache validator if it is used 2023-05-15 23:06:07 -04:00
Matthias Clasen
2f8c0b7aec tools: Cosmetics
Make gtk-builder-tool screenshot be quiet unless
it had to make up a filename. And tweak --help
output a bit.
2023-05-15 08:03:20 -04:00
Matthias Clasen
63b50f48a9 Merge branch 'harmonize-would_drop' into 'main'
Harmonize would_drop() replacement for g_log_writer_default_would_drop()

See merge request GNOME/gtk!4935
2023-04-28 22:55:42 +00:00
Matthias Clasen
2dc17aeca9 gtk4-builder-tool: Localization fixes
Be consistent about marking strings for
translation. And make locatization actually
work by including gi18n-lib.h instead of gi18n.h.
2023-03-17 22:04:25 -04:00
Matthias Clasen
3de10847b9 gtk4-builder-tool: Prefer child properties
Rewrite <child> elements to use child properties
where that is easily possible.

Fixes: #5609
2023-02-19 21:48:56 -05:00
Matthias Clasen
a9f03be588 builder-tool: Try harder to find template parents
This will make it work (in some cases) to add extra
libraries via LD_PRELOAD.

Based on work by Julian Sparber,
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5084

Fixes: #5232
2023-02-19 18:17:34 -05:00
Benjamin Otte
ac81e71f78 gtk-launch: Fix unused variable warning on macOS 2023-01-06 19:46:58 -05:00
Benjamin Otte
63fa5b7f52 gtk-launch: Remove compile-time warning
This warning causes a -Werror build to fail.
2023-01-06 19:46:58 -05:00
Matthias Clasen
1ee39d7555 tools: Stop using gtk_widget_show/hide 2022-11-28 14:34:55 -05:00
Matthias Clasen
ebe6d52252 Drop redundant glib version checks
We require GLib 2.72 now.
2022-11-17 22:49:56 -05:00
Matthias Clasen
dd60a9abd6 buildertool: Support enumerating callbacks
The new scope approach makes this easy, and
it can be useful to know what functions are
needed.
2022-10-19 13:36:14 -04:00
Matthias Clasen
50835ffbf6 buildertool: Improve validate implementation
Reimplement deprecation checking via a scope.
This lets us ignore missing callbacks, and helps
for validating templates.
2022-10-19 13:36:14 -04:00
Matthias Clasen
637713fe72 buildertool: Add a builder scope implementation
This will be used in future commits.
2022-10-19 13:36:14 -04:00
Matthias Clasen
7e71c868ab buildertool: Use --deprecations for templates
Use this option for templates too.

We still can't parse most templates, since they are
missing their callbacks.
2022-10-19 13:36:14 -04:00
Matthias Clasen
bcabe77799 buildertool: Warn about deprecations
Add a new option --deprecations to the validate
command that will warn about use of deprecated types.

The list of current deprecations is unfortunately
hardcoded in the source, so this list will have to
be kept up-to-date.

Fixes: #5256
2022-10-19 02:51:29 -04:00
Matthias Clasen
64cf31f348 buildertool: Fix template handling
We were not properly parsing the error message
here, leading to badness.
2022-10-19 02:51:29 -04:00
Matthias Clasen
4941ef659f tools: Ignore deprecations
For now, just ignore deprecations. Eventually,
we will have to go through and drop code that is
dealing with widgets that are going away.
2022-10-11 17:18:21 -04:00