Commit Graph

5027 Commits

Author SHA1 Message Date
Benjamin Otte
98bad2ea08 path: Add gsk_path_builder_add_ellipse() 2020-12-27 20:08:53 +01:00
Benjamin Otte
7e10659b0c path: Add gsk_path_measure_is_closed () 2020-12-27 20:08:53 +01:00
Benjamin Otte
38a2da88fa path: Add gsk_path_measure_restrict_to_contour() 2020-12-27 20:08:53 +01:00
Matthias Clasen
749ae52ccd Add gsk_path_measure_get_{path,tolerance}
These are just nice apis to have and avoid having to carry
these around as extra arguments in many places.

This was showing up as inconvenience in writing tests
for the measure apis.
2020-12-27 20:08:53 +01:00
Matthias Clasen
7f046e06bf Add gsk_path_get_stroke_bounds
A relatively cheap way to get bounds for the area
that would be affected by stroking a path.
2020-12-27 20:08:53 +01:00
Benjamin Otte
60a28864df WIP: pathbuilder: Add gsk_path_builder_add_rounded_rect()
It works, but does not use a custom contour yet.
2020-12-27 20:08:53 +01:00
Benjamin Otte
28d5833348 path: Add conic curves
So far this just adds the API, if you use it, you'll get lots of
g_warnings().

This will be fixed in future commits.
2020-12-27 20:08:53 +01:00
Benjamin Otte
70b84a7cc8 path: Rename to gtk_path_builder_add_segment()
It's about bulding paths, not about measuring them.
2020-12-27 20:08:53 +01:00
Benjamin Otte
6fdbe228c0 stroke: Add support for dashes
... and hook it up in the node parser and for Cairo rendering.
2020-12-27 20:08:53 +01:00
Benjamin Otte
1dd85f0a41 path: Add flags to gsk_path_foreach()
This way we can default to the siplest possible foreach() output - like
cairo_copy_path_flat() decomposing everything into lines - and add flags
to get more and more fancy.

This will be useful to have conics automatically decomposed for Cairo
drawing or if we want to add more line types in the future.
2020-12-27 20:08:53 +01:00
Matthias Clasen
04b9746bd5 Implement gsk_path_measure_in_fill
Implement this in the obvious way, using the decomposed form
of standard contours. Since the decomposed form is part of the
measure object, this api moves from gsk_path_in_fill to
gsk_path_measure_in_fill.
2020-12-27 20:08:53 +01:00
Matthias Clasen
358a7e8659 path: Implement gsk_path_parse
Implement the SVG path syntax to read back the strings
that we generate when serializing paths. The tests for
this code are taken from librsvg.

This includes an elliptical arc implementation according
to the SVG spec. The code is mostly taken from librsvg,
but pretty directly follows the SVG spec implementation
notes. We don't export this, since the parametrization
is inconvenient. We do want an arc_to API, but
these are not the arcs we are looking for.
2020-12-27 20:08:52 +01:00
Matthias Clasen
62925199e7 stroke: Add miter limit
Add a miter limit to GskStroke. This will be needed to
fully implement line joins.

Also introduce the GSK_LINE_JOIN_MITER_CLIP value,
following SVG 2.0. cairo does not have it, so translate
it to plain miter when using cairo.
2020-12-27 20:08:52 +01:00
Benjamin Otte
d0f6346922 pathbuilder: Add relative path commands
And gsk_path_builder_get_current_point().

They will be needed by the string parser.
2020-12-27 20:08:52 +01:00
Benjamin Otte
2cd08ecf77 path: Add gsk_path_measure_get_closest_point()
... and gsk_path_measure_get_closest_point_full().

Those 2 functions allow finding the closest point on a path to a given
point.
2020-12-27 20:08:52 +01:00
Benjamin Otte
4a1dcefca6 path: Add gsk_path_measure_get_point()
Allows querying the coordinates and direction of any specific point on a
path.
2020-12-27 20:08:52 +01:00
Matthias Clasen
e024982055 path: Add gsk_path_add_circle()
Adds a circle contour, too.
2020-12-27 20:08:52 +01:00
Benjamin Otte
9fd1dea356 pathmeasure: Implement support for beziers
Instead of treating bezier curves as lines, we properly decompose them
into line segments now so that we can treat those as lines.
2020-12-27 20:08:52 +01:00
Benjamin Otte
7ff39c6b60 path: Add gsk_path_foreach() 2020-12-27 20:08:52 +01:00
Benjamin Otte
53b64f63f1 pathmeasure: Add gsk_path_measure_add_segment()
This allows chunking paths, weeee.
2020-12-27 20:08:52 +01:00
Benjamin Otte
1783c9bdd8 path: Add gsk_path_builder_add_path() 2020-12-27 20:08:52 +01:00
Benjamin Otte
0e69f58c2b gsk: Add GskPathMeasure
An object to do measuring operations on paths - determining their
length, cutting off subpaths, things like that.
2020-12-27 20:08:52 +01:00
Benjamin Otte
ca2059bb13 snapshot: Add gtk_snapshot_push_stroke() 2020-12-27 20:08:52 +01:00
Benjamin Otte
b9c6586d96 gsk: Add GskStroke
It's unused in this commit. This just prepares the new object.
2020-12-27 20:08:52 +01:00
Benjamin Otte
95e72be25c snapshot: Add gtk_snapshot_push_fill() 2020-12-27 20:08:52 +01:00
Benjamin Otte
89cb8625fa gsk: Add GskFillNode
Take a rendernode as source and a GskPath and fill the region in the
path just like cairo_fill() would.
2020-12-27 20:08:52 +01:00
Benjamin Otte
8c6c1c6ffc gsk: Add GskPath 2020-12-27 20:08:52 +01:00
Benjamin Otte
72f5c6d931 API: Add gtk_picture_add_paintable_bounds()
Allows a caller to see where a picture has placed a paintable.
2020-12-27 20:08:52 +01:00
Matthias Clasen
7e579bb59a Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!2997
2020-12-24 07:13:22 +00:00
Benjamin Otte
f85d939e5e docs: Put render nodes in their own sections 2020-12-24 06:38:45 +01:00
Emmanuele Bassi
6c31ed53f4 docs: Fix typo and whitespace 2020-12-21 17:03:42 +00:00
wisp3rwind
9521f609d8 docs: backtick fixes
- in the gettext() examples, at least the _() triggers italics
- add missing closing backtick
2020-12-18 16:31:41 +01:00
Matthias Clasen
d33062795c Merge branch 'ebassi/docs-for-master' into 'master'
Ebassi/docs for master

See merge request GNOME/gtk!2971
2020-12-17 23:59:41 +00:00
Matthias Clasen
3f56e8191f Merge branch 'shortcuts' into 'master'
docs: Add separation between kinds of shortcuts in Keyboard input

See merge request GNOME/gtk!2964
2020-12-17 19:43:38 +00:00
Chris Mayo
bf4c3dc2c5 docs: Fix list of kinds of shortcuts in Keyboard input
Formatting in HTML was mangled.
2020-12-17 19:18:10 +00:00
Emmanuele Bassi
a5365ec8cb docs: Add missing GTK types
If we don't specify the get_type() function, gtk-doc will not collect
properties and signals, and will use a different URL for the page.
2020-12-17 18:30:19 +00:00
Sebastian Keller
02f0681344 settings: Change gtk-cursor-aspect-ratio from float to double
Float properties can not be read from keyfiles. This was causing changes
to this property in settings.ini to be ignored. Fix this by changing it
to a double.

Technically this change could be considered an API break, but there are
no users of this property as float yet and it is early enough to expect
there to never be any.

Also document this change in the 3 to 4 migration guide since in gtk 3
this setting will be kept a float.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 22:35:36 +01:00
Emmanuele Bassi
9fa4c2f5b8 docs: Ignore gtkspinbuttonprivate.h 2020-12-16 16:29:01 +00:00
Emmanuele Bassi
73dda96711 docs: Add missing stanzas for gtk_test_accessible API 2020-12-16 16:29:01 +00:00
Emmanuele Bassi
d711acc954 docs: Ignore gtksorterprivate.h 2020-12-16 16:29:01 +00:00
Emmanuele Bassi
f24429e84a docs: Remove private symbols 2020-12-16 16:29:00 +00:00
Emmanuele Bassi
fc4402b456 docs: Ignore gtkpasswordentryprivate.h 2020-12-16 16:29:00 +00:00
Emmanuele Bassi
344eb21bee docs: Complete symbol coverage for GSK
100% symbol docs coverage.
241 symbols documented.
0 symbols incomplete.
0 not documented.
2020-12-16 16:29:00 +00:00
Emmanuele Bassi
4fb55b3270 docs: Complete symbol coverage for GDK
100% symbol docs coverage.
833 symbols documented.
0 symbols incomplete.
0 not documented.

What's left are just type system macros and windowing system opaque
structures.
2020-12-16 16:28:58 +00:00
Emmanuele Bassi
5d2278a5ca docs: Add public symbols to the GTK reference 2020-12-15 16:21:20 +00:00
Emmanuele Bassi
ea5e186bb8 Hide GtkTextAttributes functions
The type is private, so making functions operating on it public is
pointless.
2020-12-15 16:20:21 +00:00
Emmanuele Bassi
3132b10bc0 docs: Add more private headers 2020-12-15 15:55:06 +00:00
Emmanuele Bassi
91bba794a6 docs: Add missing symbols to the GTK reference 2020-12-15 14:30:32 +00:00
Emmanuele Bassi
a6bd0c7eed Remove stray mentions of GdkConfigureEvent
The event was removed, but some traces of it linger.
2020-12-15 13:58:52 +00:00
Emmanuele Bassi
ff351721b2 docs: Add missing symbols to the GDK reference 2020-12-15 13:47:40 +00:00