]> granicus.if.org Git - graphviz/log
graphviz
2 years agocommon pos_html_cell: fix unchecked allocation failure
Matthew Fernandez [Fri, 14 Oct 2022 04:01:46 +0000 (21:01 -0700)]
common pos_html_cell: fix unchecked allocation failure

2 years agocommon initAnchor: fix unchecked allocation failure
Matthew Fernandez [Fri, 14 Oct 2022 04:01:28 +0000 (21:01 -0700)]
common initAnchor: fix unchecked allocation failure

2 years agoJSON plugin stoj: use a statically sized staging buffer instead of an agxbuf
Matthew Fernandez [Fri, 14 Oct 2022 03:48:17 +0000 (20:48 -0700)]
JSON plugin stoj: use a statically sized staging buffer instead of an agxbuf

This removes some dynamic allocation, as well as making this function now thread
safe. Note that the contained call to `latin1ToUTF8` still allocates.

2 years agoJSON plugin: move printing of escaped string inside 'stoj'
Matthew Fernandez [Fri, 14 Oct 2022 03:28:32 +0000 (20:28 -0700)]
JSON plugin: move printing of escaped string inside 'stoj'

This is preparation for refactoring `stoj` to remove dynamic memory allocation.

2 years agoMerge branch 'smattr/07c690c2-bf9b-4aba-a3be-31defa322cfb' into 'main'
Matthew Fernandez [Fri, 14 Oct 2022 01:38:03 +0000 (01:38 +0000)]
Merge branch 'smattr/07c690c2-bf9b-4aba-a3be-31defa322cfb' into 'main'

bump required CMake version to 3.13.0

See merge request graphviz/graphviz!2905

2 years agobump required CMake version to 3.13.0
Matthew Fernandez [Thu, 13 Oct 2022 00:52:52 +0000 (17:52 -0700)]
bump required CMake version to 3.13.0

This allows dropping several workarounds in the CMake build system. The only
supported platform with a CMake version less than 3.13.0 is Ubuntu 18.04. Given
CMake is not the default build system, the age of Ubuntu 18.04 makes it unlikely
there are users there building Graphviz from source, and later CMake versions
are easily obtainable from Kitware, it seems reasonable to increase this
requirement.

Gitlab: #2290

2 years agoCI: on Ubuntu 18.04, install CMake from Kitware instead of Apt
Matthew Fernandez [Wed, 12 Oct 2022 04:43:55 +0000 (21:43 -0700)]
CI: on Ubuntu 18.04, install CMake from Kitware instead of Apt

This moves the CMake version available on this platform from 3.10.2 to 3.24.2.
The new CMake floor is 3.16.3, determined by Ubuntu 20.04.

Gitlab: #2290

2 years agoMerge branch 'smattr/85e882d7-72ce-408a-91ca-8ef4a2de2ad5' into 'main'
Matthew Fernandez [Thu, 13 Oct 2022 05:16:50 +0000 (05:16 +0000)]
Merge branch 'smattr/85e882d7-72ce-408a-91ca-8ef4a2de2ad5' into 'main'

remove calls to 'rsvg_term'

See merge request graphviz/graphviz!2888

2 years agorsvg plugin gvloadimage_rsvg_cairo: remove unnecessary parens
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
rsvg plugin gvloadimage_rsvg_cairo: remove unnecessary parens

2 years agorsvg plugin gvloadimage_rsvg_cairo: squash -Wunused-parameter warning
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
rsvg plugin gvloadimage_rsvg_cairo: squash -Wunused-parameter warning

This function is used as a callback, so its unused parameter cannot easily be
removed.

2 years agorsvg plugin gvloadimage_rsvg_load: remove unnecessary cast
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
rsvg plugin gvloadimage_rsvg_load: remove unnecessary cast

2 years agorsvg plugin gvloadimage_rsvg_load: remove unnecessary use of gboolean
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
rsvg plugin gvloadimage_rsvg_load: remove unnecessary use of gboolean

2 years agoremove calls to 'rsvg_term'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
remove calls to 'rsvg_term'

The `rsvg_term` function has been a no-op for some time:¹

  rsvg_term has been deprecated since version 2.36 and should not be used in
  newly-written code.
  There is no need to de-initialize librsvg.
  This function does nothing.

Graphviz was calling it when linked against librsvg 2.36 (2.36.0 was released
2012-03-26). I do not know why this code was conditional as `rsvg_term` has been
a no-op since 2.35.0.² Moreover, calling it prior to it becoming a no-op was
wrong too. The commit that removed its functionality notes:

  rsvg_term() was dangerous to call

The problem is that it previously called libxml2’s `xmlCleanupParser` whose
documentation states:³

  This function name is somewhat misleading. It does not clean up parser state,
  it cleans up memory allocated by the library itself. It is a cleanup function
  for the XML library. It tries to reclaim all related global memory allocated
  for the library processing. It doesn't deallocate any document related memory.
  One should call xmlCleanupParser() only when the process has finished using
  the library and all XML/HTML documents built with it. See also xmlInitParser()
  which has the opposite function of preparing the library for operations.
  WARNING: if your application is multithreaded or has plugin support calling
  this may crash the application if another thread or a plugin is still using
  libxml2. It's sometimes very hard to guess if libxml2 is in use in the
  application, some libraries or plugins may use it without notice. In case of
  doubt abstain from calling this function or do it just before calling exit()
  to avoid leak reports from valgrind !

This seems to have come to light ~2010.⁴ But presumably there is still a long
tail of software in the wild still, like Graphviz, erroneously calling
`rsvg_term`.

¹ https://www.manpagez.com/html/rsvg-2.0/rsvg-2.0-2.52.1/RsvgHandle.php#rsvg-term
² Commit 7f27418cfcdea9cdd6b2bf81ea0b0f6cc5a18b30 of librsvg.
³ https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlCleanupParser
⁴ https://lists.fedoraproject.org/pipermail/devel/2010-January/129117.html
  https://bugzilla.redhat.com/show_bug.cgi?id=542277
  https://bugzilla.gnome.org/show_bug.cgi?id=592100

2 years agoMerge branch 'smattr/95708189-94d5-485b-a0c1-5face69b647d' into 'main'
Matthew Fernandez [Thu, 13 Oct 2022 02:09:48 +0000 (02:09 +0000)]
Merge branch 'smattr/95708189-94d5-485b-a0c1-5face69b647d' into 'main'

gvc: remove dead code, swap some stat() for access()

See merge request graphviz/graphviz!2902

2 years agogvc: remove unused 'gv_argvlist_free'
Matthew Fernandez [Tue, 11 Oct 2022 01:36:29 +0000 (18:36 -0700)]
gvc: remove unused 'gv_argvlist_free'

The last use of this was removed in b3a03d1279b00565991abb4f0354c28f69e97650.

2 years agogvc: remove unused 'gvNEWargvlist'
Matthew Fernandez [Tue, 11 Oct 2022 01:36:03 +0000 (18:36 -0700)]
gvc: remove unused 'gvNEWargvlist'

This seems to have never been used.

2 years agogvc gvplugin_library_load: replace read check using 'stat' with using 'access'
Matthew Fernandez [Tue, 11 Oct 2022 01:19:18 +0000 (18:19 -0700)]
gvc gvplugin_library_load: replace read check using 'stat' with using 'access'

This probably uses `stat` under the hood too, but is slightly more concise and
clear about intent.

2 years agogvc gvconfig: replace existence check using 'stat' with using 'access'
Matthew Fernandez [Tue, 11 Oct 2022 01:13:19 +0000 (18:13 -0700)]
gvc gvconfig: replace existence check using 'stat' with using 'access'

This probably uses `stat` under the hood too, but is slightly more concise and
clear about intent.

2 years agoMerge branch 'smattr/63fa6275-5ac8-4657-9b09-05d3c82776e2' into 'main'
Matthew Fernandez [Thu, 13 Oct 2022 01:03:21 +0000 (01:03 +0000)]
Merge branch 'smattr/63fa6275-5ac8-4657-9b09-05d3c82776e2' into 'main'

stop enabling -ffast-math on any platform

Closes #2296 and #1412

See merge request graphviz/graphviz!2904

2 years agoremove no longer needed 'FPERR' work around
Matthew Fernandez [Wed, 12 Oct 2022 04:29:06 +0000 (21:29 -0700)]
remove no longer needed 'FPERR' work around

As of the previous commit, `-ffast-math` is no longer enabled, so this is not
needed any more.

Gitlab: #1412, #2296

2 years agostop enabling -ffast-math on any platform
Matthew Fernandez [Wed, 12 Oct 2022 04:10:54 +0000 (21:10 -0700)]
stop enabling -ffast-math on any platform

The `-ffast-math` compiler option enables a mode of floating point semantics
that are heavily relaxed from strict IEEE 754 conformance in the name of speed.¹
The permissible optimizations under `-ffast-math` include transformations that
produce floating point results most users would consider wrong. It is unclear
why “do math fast but incorrectly” is a useful mode. It seems the world is
finally coming around to this tenet.²

This change stops enabling `-ffast-math` anywhere in the Autotools build system.

Gitlab: fixes #1412, #2296
Reported-by: Kasper Daniel Hansen
Reported-by: Ross Barnowski
¹ https://gcc.gnu.org/wiki/FloatingPointMath
² https://simonbyrne.github.io/notes/fastmath/,
  https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html

2 years agoremove suppression of -ffast-math when building with ICC
Matthew Fernandez [Wed, 12 Oct 2022 04:02:18 +0000 (21:02 -0700)]
remove suppression of -ffast-math when building with ICC

The Intel C Compiler does not support the `-ffast-math` command line option, so
this logic was suppressing it. But it is coming before anything in the Graphviz
build system itself that would add `-ffast-math`. So it is actually suppressing
a `-ffast-math` addition coming from the user’s environment. If you are a user
compiling Graphviz with ICC, I have a very simple alternative for you: do not
pass `-ffast-math` explicitly.

Gitlab: #1412, #2296

2 years agowrap over-long CHANGELOG lines
Matthew Fernandez [Wed, 12 Oct 2022 04:07:58 +0000 (21:07 -0700)]
wrap over-long CHANGELOG lines

2 years agocommon miter_point: fix comment typo
Matthew Fernandez [Wed, 12 Oct 2022 03:59:30 +0000 (20:59 -0700)]
common miter_point: fix comment typo

2 years agoMerge branch 'smattr/14781c34-102f-4608-96e5-87899b5c5213' into 'main'
Matthew Fernandez [Wed, 12 Oct 2022 15:54:54 +0000 (15:54 +0000)]
Merge branch 'smattr/14781c34-102f-4608-96e5-87899b5c5213' into 'main'

common: some minor clean up

See merge request graphviz/graphviz!2896

2 years agocommon arrow_flags: abbreviate some bitwise assignments
Matthew Fernandez [Sat, 8 Oct 2022 22:35:52 +0000 (15:35 -0700)]
common arrow_flags: abbreviate some bitwise assignments

2 years agocommon: remove unnecessary parens
Matthew Fernandez [Sat, 8 Oct 2022 22:35:42 +0000 (15:35 -0700)]
common: remove unnecessary parens

2 years agocommon: use a simpler C99 zero init for null terminating 'Arrownames'
Matthew Fernandez [Sat, 8 Oct 2022 22:27:52 +0000 (15:27 -0700)]
common: use a simpler C99 zero init for null terminating 'Arrownames'

2 years agocommon: mark 'Arrownames' const
Matthew Fernandez [Sat, 8 Oct 2022 22:27:42 +0000 (15:27 -0700)]
common: mark 'Arrownames' const

2 years agocommon: use a simpler C99 zero init for null terminating 'Arrowmods'
Matthew Fernandez [Sat, 8 Oct 2022 22:27:20 +0000 (15:27 -0700)]
common: use a simpler C99 zero init for null terminating 'Arrowmods'

2 years agocommon: mark 'Arrowmods' const
Matthew Fernandez [Sat, 8 Oct 2022 22:27:00 +0000 (15:27 -0700)]
common: mark 'Arrowmods' const

2 years agocommon: use a simpler C99 zero init for null terminating 'Arrowsynonyms'
Matthew Fernandez [Sat, 8 Oct 2022 22:26:35 +0000 (15:26 -0700)]
common: use a simpler C99 zero init for null terminating 'Arrowsynonyms'

2 years agocommon: mark 'Arrowsynonyms' const
Matthew Fernandez [Sat, 8 Oct 2022 22:26:11 +0000 (15:26 -0700)]
common: mark 'Arrowsynonyms' const

2 years agocommon arrow_match_name_frag: take 'arrownames' parameter as const
Matthew Fernandez [Sat, 8 Oct 2022 22:25:01 +0000 (15:25 -0700)]
common arrow_match_name_frag: take 'arrownames' parameter as const

2 years agocommon: use a simpler C99 zero init for null terminating 'Arrowdirs'
Matthew Fernandez [Sat, 8 Oct 2022 22:22:30 +0000 (15:22 -0700)]
common: use a simpler C99 zero init for null terminating 'Arrowdirs'

2 years agocommon: mark 'Arrowdirs' constant
Matthew Fernandez [Sat, 8 Oct 2022 22:19:31 +0000 (15:19 -0700)]
common: mark 'Arrowdirs' constant

2 years agoMerge branch 'getopt' into 'main'
Mark Hansen [Wed, 12 Oct 2022 09:56:52 +0000 (09:56 +0000)]
Merge branch 'getopt' into 'main'

Avoid uninitialized CMake GETOPT variable warnings

See merge request graphviz/graphviz!2894

2 years agoAvoid uninitialized CMake GETOPT variable warnings
Mark Hansen [Sat, 8 Oct 2022 10:21:49 +0000 (21:21 +1100)]
Avoid uninitialized CMake GETOPT variable warnings

Only access GETOPT_INCLUDE_DIRS if GETOPT is found.

Fix a few warnings with --warn-uninitialized like:

```
CMake Warning (dev) at cmd/gvmap/CMakeLists.txt:20
(target_include_directories):
  uninitialized variable 'GETOPT_INCLUDE_DIRS'
```

Towards #2291

2 years agoMerge branch 'devil' into 'main'
Mark Hansen [Wed, 12 Oct 2022 07:47:16 +0000 (07:47 +0000)]
Merge branch 'devil' into 'main'

DevIL plugin: use IL_ CMake variables

Closes #2289

See merge request graphviz/graphviz!2891

2 years agoDevIL plugin: use IL_ CMake variables
Mark Hansen [Sat, 8 Oct 2022 05:58:56 +0000 (16:58 +1100)]
DevIL plugin: use IL_ CMake variables

https://cmake.org/cmake/help/latest/module/FindDevIL.html#result-variables
mentions that FindDevIL CMake module sets the following, frustratingly
inconsistent variables:

- IL_LIBRARIES
- IL_INCLUDE_DIR
- DevIL_FOUND

Note I can't actually test this on my local machine, so I'll be relying
on CI.

Fixes #2289

2 years agoMerge branch 'smattr/c0acb230-1b61-4e7b-9922-aab37aeda9f7' into 'main'
Matthew Fernandez [Wed, 12 Oct 2022 03:44:08 +0000 (03:44 +0000)]
Merge branch 'smattr/c0acb230-1b61-4e7b-9922-aab37aeda9f7' into 'main'

bump required CMake version to 3.10.2

See merge request graphviz/graphviz!2898

2 years agobump required CMake version to 3.10.2
Matthew Fernandez [Sun, 9 Oct 2022 17:45:35 +0000 (10:45 -0700)]
bump required CMake version to 3.10.2

Of the platforms Graphviz supports, the one with the oldest CMake version
available is Ubuntu 18.04, which has CMake 3.10.2. This change raises the
baseline CMake requirement to indicate we no longer support CMake 3.9.

The diff between CMake 3.9 and 3.10 does not actually contain anything useful to
Graphviz. But it still seems wise to proactively move our floor forwards.

2 years agoCI: when using CMake, echo its version into the log
Matthew Fernandez [Sun, 9 Oct 2022 17:21:32 +0000 (10:21 -0700)]
CI: when using CMake, echo its version into the log

Useful for debugging.

2 years agoMerge branch 'smattr/d4a525e3-e3d6-489c-b64d-a901f96bdfdd' into 'main'
Matthew Fernandez [Wed, 12 Oct 2022 01:09:37 +0000 (01:09 +0000)]
Merge branch 'smattr/d4a525e3-e3d6-489c-b64d-a901f96bdfdd' into 'main'

remove 'MOSEK'-guarded code

See merge request graphviz/graphviz!2889

2 years agoneatogen: remove now unused 'delete_digcola_levels'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
neatogen: remove now unused 'delete_digcola_levels'

2 years agoneatogen: remove now unused 'print_digcola_levels'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
neatogen: remove now unused 'print_digcola_levels'

2 years agoremove 'MOSEK'-guarded code
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
remove 'MOSEK'-guarded code

Noting in the build systems defines this.

2 years agoMerge branch 'link-libraries' into 'main'
Mark Hansen [Tue, 11 Oct 2022 22:28:34 +0000 (22:28 +0000)]
Merge branch 'link-libraries' into 'main'

Use full paths to pangocairo libraries, not names

See merge request graphviz/graphviz!2890

2 years agoUse full paths to pangocairo libraries, not names
Mark Hansen [Sat, 8 Oct 2022 03:32:49 +0000 (14:32 +1100)]
Use full paths to pangocairo libraries, not names

This lets me build on macOS.

Thanks to Matthew for finding this fix for #2286

There are a few other usages of PANGOCAIRO_LIBRARIES within Graphviz,
but none that I'm currently compiling on macOS. Maybe those should be
moved too, but I've just started with this one.

2 years agoMerge branch 'fix-issue-372-for-polygon-shaped-nodes-and-normal-arrows' into 'main'
Magnus Jacobsson [Tue, 11 Oct 2022 20:46:22 +0000 (20:46 +0000)]
Merge branch 'fix-issue-372-for-polygon-shaped-nodes-and-normal-arrows' into 'main'

Fix overlap caused by penwidth for polygon-based nodes and normal and inv edge arrows

Closes #372

See merge request graphviz/graphviz!2701

2 years agoshapes: point_init/point_inside: fix clipping of edge at node outline
Magnus Jacobsson [Fri, 16 Sep 2022 10:35:53 +0000 (12:35 +0200)]
shapes: point_init/point_inside: fix clipping of edge at node outline

Take node penwidth into account for the point node shape

Following the fix for polygon and ellipse shapes except the 'point'
shape, this fixes the second part of arrow not respecting penwidth for
the 'point' shape. A similar fix needs to be applied to fix the second
part for the 'cylinder' node shape.

The test_edge_node_overlap_point_node_shape test now succeeds, so the
expectancy that it should fail is removed.

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agoshapes: poly_init: fix clipping of edge at node outline for ellipse node shapes
Magnus Jacobsson [Fri, 16 Sep 2022 08:53:36 +0000 (10:53 +0200)]
shapes: poly_init: fix clipping of edge at node outline for ellipse node shapes

Take node penwidth into account also for ellipse node shapes.

Following the fix for polygon node shapes, this fixes the second part
of arrow not respecting penwith for ellipse shapes other than
'point'. Similar fixes need to be applied to fix the second part for
the 'point' and 'cylinder' node shapes.

The test_edge_node_overlap_ellipse_node_shapes_except_point test now
succeeds, so the expectancy that it should fail is removed.

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agoarrows: arrow_type_normal0: fix positioning of normal/inv arrow also for l/r modifiers
Magnus Jacobsson [Thu, 15 Sep 2022 12:12:16 +0000 (14:12 +0200)]
arrows: arrow_type_normal0: fix positioning of normal/inv arrow also for l/r modifiers

The test_edge_node_overlap_normal_and_inv_edge_arrows_all_modifiers
now succeeds, so the expectancy that it should fail is removed.

2 years agoarrows: miter_point: add fallback to bevel
Magnus Jacobsson [Thu, 15 Sep 2022 17:01:54 +0000 (19:01 +0200)]
arrows: miter_point: add fallback to bevel

The 'l' and 'r' arrow shape modifiers make the arrow tip have a sharp
angle and causes the normal miter point to exceed the 'miter-limit'
and SVG renderers to fall back to a bevelled corner.

2 years agoarrows: arrow_length_normal: take edge penwidth into account when calculating length
Magnus Jacobsson [Sun, 17 Apr 2022 16:55:50 +0000 (18:55 +0200)]
arrows: arrow_length_normal: take edge penwidth into account when calculating length

This causes the edge stem to be clipped at the visual outline of the
edge arrow instead of at its "ideal" bounding box which fixes the too
large overlap between them that was introduced by eariler commits in
this series.

The test_max_edge_stem_arrow_overlap_simple.cpp,
test_edge_node_overlap_normal_and_inv_edge_arrows
test_edge_node_overlap_simple and test_edge_node_overlap_node_shapes
test cases now succeed, so the expectancy that they should fail is
removed.

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agoarrows: factor out arrow_type_normal0 function
Magnus Jacobsson [Sun, 17 Apr 2022 16:05:47 +0000 (18:05 +0200)]
arrows: factor out arrow_type_normal0 function

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agoarrows: refactor arrow length calculation to allow arrow type specific length functions
Magnus Jacobsson [Sun, 17 Apr 2022 15:45:24 +0000 (17:45 +0200)]
arrows: refactor arrow length calculation to allow arrow type specific length functions

Add a len function to arrowtype_t. This is currently a no-op. All
arrow types use a generic function that just returns the nominal
length. Future commits will replace the generic function with
functions specific for each arrow type.

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agosplines: bezier_clip: change to clip just inside instead of just outside the node
Magnus Jacobsson [Wed, 13 Apr 2022 21:01:41 +0000 (23:01 +0200)]
splines: bezier_clip: change to clip just inside instead of just outside the node

The previous changes removed *all* overlap between nodes and edges at
the expense of creating a very small gap instead. This is visually not
very pleasing. This change ensures that we get a very small minimum
overlap instead.

The test_min_edge_node_overlap_simple and
test_min_edge_node_overlap_node_shapes tests tests now succeed, so the
expectancy that they should fail is removed.

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agoshapes: star_inside: fix clipping of edge at node outline
Magnus Jacobsson [Wed, 14 Sep 2022 19:58:57 +0000 (21:58 +0200)]
shapes: star_inside: fix clipping of edge at node outline

Take node penwidth into account when doing the clipping of the 'star'
shape. This causes the clipping to occur at the visible node outline
instead of at the "ideal" bounding box which does not take node
penwidth into account.

For the star shape, this fixes the second part of arrow not respecting
penwidth. Similar fixes need to be applied to fix the second part for
other node shapes.

The test_max_edge_node_overlap_node_shapes test case now succeeds, so
the expectancy that it should fail is removed.

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agoshapes: poly_init/poly_inside: fix clipping of edge at node outline
Magnus Jacobsson [Mon, 11 Apr 2022 18:06:26 +0000 (20:06 +0200)]
shapes: poly_init/poly_inside: fix clipping of edge at node outline

Take node penwidth into account when doing the clipping. This causes
the clipping to occur at the visible node outline instead of at the
"ideal" bounding box which assumes a zero node penwidth.

For polygon shapes, this fixes the second part of arrow not respecting
penwidth. Similar fixes need to be applied to fix the second part for
other node shapes.

The test_max_edge_node_overlap_simple test now succeeds, so the
expectancy that it should fail is removed.

The test_min_edge_node_overlap_simple and
test_min_edge_node_overlap_node_shapes tests now fail since there's
now a small gap between the edge and the node, so they're temporarily
set to be expected to fail. This gap will be removed in an upcoming
commit in this series.

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agoAPI BREAK: types: add outline_width & outline_height to Agnodeinfo_t struct
Magnus Jacobsson [Sat, 24 Sep 2022 14:18:24 +0000 (16:18 +0200)]
API BREAK: types: add outline_width & outline_height to Agnodeinfo_t struct

2 years agoarrows: arrow_type_normal: fix positioning of normal/inv arrow
Magnus Jacobsson [Wed, 4 May 2022 19:17:12 +0000 (21:17 +0200)]
arrows: arrow_type_normal: fix positioning of normal/inv arrow

Take edge penwidth into account when calculating the outline of the
edge arrrow shape instead of using the "ideal" arrow shape assuming
zero penwidth.

This change moves the tip of the arrow so that it does not overlap the
node periphery assuming that the node penwidth is zero. To account for
the node penwidth is the second part that will be adressed in upcoming
commits.

For normal and inv arrows not using the 'l' or 'r' arrow shape
modifiers, this fixes the first part of arrow not respecting
penwith. Similar fixes need to be applied to fix the first part for
other arrow types. The 'l' and 'r' shape modifiers will handled in an
upcoming commit in this series.

The test_max_edge_stem_arrow_overlap_simple test case now fails since
there's now a slightly too large overlap between the edge stem and its
arrow heads, so the test case is temporarily set to be expected to
fail. This small overlap will be removed in an upcoming commit in this
series.

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agoarrows: refactor arrow generating functions to return the actual start point
Magnus Jacobsson [Sun, 27 Mar 2022 10:56:45 +0000 (12:56 +0200)]
arrows: refactor arrow generating functions to return the actual start point

This is currently a no-op, but upcoming commits will adjust the arrow
start point to take pendwidth into account in order to avoid
overlapping the node periphery and subsequent primitive arrow shapes
of multi-shape arrows.

The arrow start point is the point on the arrow which is farthest away
along the edge from the node it is associated with.

Towards https://gitlab.com/graphviz/graphviz/-/issues/372.

2 years agotests: remove test_regression_subset_differences test
Magnus Jacobsson [Sun, 3 Apr 2022 15:24:21 +0000 (17:24 +0200)]
tests: remove test_regression_subset_differences test

Upcoming commits will step by step make changes that affect the layout
and there's too much work to maintain the reference files, since they
differ slightly across operating systems. We only checked for
difference for a very small fraction of the subtests anyway so this
test did not add much value.

Note that the test_regression_failure test remains. It checks the exit
status of each subtest, but does not compare with reference files.

2 years agotests: SVGAnalyzer: correct fallback to bevel in SVGElement::miter_point
Magnus Jacobsson [Mon, 10 Oct 2022 06:41:06 +0000 (08:41 +0200)]
tests: SVGAnalyzer: correct fallback to bevel in SVGElement::miter_point

This corrects a mistake made in a8b2c299931c9c7037a67e9064b4749390655c0c.

2 years agotests: test_max_edge_stem_arrow_overlap_simple: correct test description
Magnus Jacobsson [Wed, 5 Oct 2022 11:47:13 +0000 (13:47 +0200)]
tests: test_max_edge_stem_arrow_overlap_simple: correct test description

2 years agotests: test_min_edge_stem_arrow_overlap_simple: correct test description
Magnus Jacobsson [Wed, 5 Oct 2022 11:47:32 +0000 (13:47 +0200)]
tests: test_min_edge_stem_arrow_overlap_simple: correct test description

2 years agoMerge branch 'start-6.0.3-dev' into 'main'
Magnus Jacobsson [Tue, 11 Oct 2022 19:37:04 +0000 (19:37 +0000)]
Merge branch 'start-6.0.3-dev' into 'main'

Start 6.0.3 development

See merge request graphviz/graphviz!2903

2 years agoStart 6.0.3 development
Magnus Jacobsson [Tue, 11 Oct 2022 17:34:48 +0000 (19:34 +0200)]
Start 6.0.3 development

2 years agoMerge branch 'stable-release-6.0.2' into 'main' 6.0.2
Magnus Jacobsson [Tue, 11 Oct 2022 18:28:33 +0000 (18:28 +0000)]
Merge branch 'stable-release-6.0.2' into 'main'

Stable release 6.0.2

See merge request graphviz/graphviz!2900

2 years agoStable release 6.0.2
Magnus Jacobsson [Mon, 10 Oct 2022 06:49:52 +0000 (08:49 +0200)]
Stable release 6.0.2

2 years agoMerge branch 'cairo-svg' into 'main'
Mark Hansen [Tue, 11 Oct 2022 10:00:54 +0000 (10:00 +0000)]
Merge branch 'cairo-svg' into 'main'

Import cairo-svg.h without cairo/ prefix

Closes #2227

See merge request graphviz/graphviz!2892

2 years agoDraft: import cairo-svg without cairo/ prefix cairo-svg
Mark Hansen [Fri, 7 Oct 2022 23:59:00 +0000 (10:59 +1100)]
Draft: import cairo-svg without cairo/ prefix

Some places in our codebase we load `cairo.h` directly.

I'm wondering whether this will pass CI

Towards #2227

2 years agoMerge branch 'gdk' into 'main'
Mark Hansen [Tue, 11 Oct 2022 06:58:26 +0000 (06:58 +0000)]
Merge branch 'gdk' into 'main'

Use _LINK_LIBRARIES to build gdk plugin

See merge request graphviz/graphviz!2893

2 years agoUse _LINK_LIBRARIES to build gdk plugin
Mark Hansen [Sat, 8 Oct 2022 06:42:23 +0000 (17:42 +1100)]
Use _LINK_LIBRARIES to build gdk plugin

This makes them work on my macOS machine that's installed GTK with
homebrew.

Otherwise I get errors like:

```
ld: library not found for -lgdk-quartz-2.0
```

Towards #2290

2 years agoMerge branch 'smattr/031b9571-2190-4d4c-b5e3-fa0403e651c3' into 'main'
Matthew Fernandez [Tue, 11 Oct 2022 06:05:04 +0000 (06:05 +0000)]
Merge branch 'smattr/031b9571-2190-4d4c-b5e3-fa0403e651c3' into 'main'

common: some minor clean up

See merge request graphviz/graphviz!2899

2 years agocommon: remove some unnecessary parens
Matthew Fernandez [Sun, 9 Oct 2022 20:21:32 +0000 (13:21 -0700)]
common: remove some unnecessary parens

2 years agocommon: replace some 'MIN' usage with 'fmax'
Matthew Fernandez [Sun, 9 Oct 2022 20:15:09 +0000 (13:15 -0700)]
common: replace some 'MIN' usage with 'fmax'

`fmin` is typically implemented as a compiler built-in and has the potential to
be more efficient than `MIN`, while also avoiding the loss of type safety and
double-expansion problems of macros.

2 years agocommon: replace some 'MAX' usage with 'fmax'
Matthew Fernandez [Sun, 9 Oct 2022 20:13:08 +0000 (13:13 -0700)]
common: replace some 'MAX' usage with 'fmax'

`fmax` is typically implemented as a compiler built-in and has the potential to
be more efficient than `MAX`, while also avoiding the loss of type safety and
double-expansion problems of macros.

2 years agocommon: remove unused 'PI' constant
Matthew Fernandez [Sun, 9 Oct 2022 20:12:07 +0000 (13:12 -0700)]
common: remove unused 'PI' constant

2 years agoMerge branch 'smattr/8908405f-7c1a-4657-8118-0c64f585ee8b' into 'main'
Matthew Fernandez [Tue, 11 Oct 2022 04:33:44 +0000 (04:33 +0000)]
Merge branch 'smattr/8908405f-7c1a-4657-8118-0c64f585ee8b' into 'main'

sfio: squash some compiler warnings

See merge request graphviz/graphviz!2884

2 years agosfio _Sftable: use C99 designated field initializers
Matthew Fernandez [Fri, 7 Oct 2022 03:46:28 +0000 (20:46 -0700)]
sfio _Sftable: use C99 designated field initializers

Squashes a number of -Wmissing-field-initializer warnings.

2 years agosfio sfcvinit: use more appropriate types, squashing -Wconversion warnings
Matthew Fernandez [Fri, 7 Oct 2022 03:46:01 +0000 (20:46 -0700)]
sfio sfcvinit: use more appropriate types, squashing -Wconversion warnings

2 years agosfio sfsync: realign 'mode' type with its use
Matthew Fernandez [Fri, 7 Oct 2022 03:25:30 +0000 (20:25 -0700)]
sfio sfsync: realign 'mode' type with its use

Squashes a -Wsign-conversion warning.

2 years agosfio sfsync: realign 'pool' type with its use
Matthew Fernandez [Fri, 7 Oct 2022 03:13:09 +0000 (20:13 -0700)]
sfio sfsync: realign 'pool' type with its use

Squashes a -Wsign-conversion warning.

2 years agosfio sfswap: realign 'f1mode' type with its use
Matthew Fernandez [Fri, 7 Oct 2022 03:00:33 +0000 (20:00 -0700)]
sfio sfswap: realign 'f1mode' type with its use

Squashes three -Wsign-conversion warnings.

2 years agoMerge branch 'smattr/2fd13139-2ce0-4774-bd07-42eaf6061030' into 'main'
Matthew Fernandez [Tue, 11 Oct 2022 03:23:37 +0000 (03:23 +0000)]
Merge branch 'smattr/2fd13139-2ce0-4774-bd07-42eaf6061030' into 'main'

glcomp: remove dead code

See merge request graphviz/graphviz!2879

2 years agoglcomp: remove 'glCompButton.glyphPos' and associated constants
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
glcomp: remove 'glCompButton.glyphPos' and associated constants

These have seemingly never been used.

2 years agoglcomp: remove unused 'glCompLabel.autosize'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
glcomp: remove unused 'glCompLabel.autosize'

This field has seemingly never been used.

2 years agoglcomp: remove unnecessary casts of 'compset' member
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
glcomp: remove unnecessary casts of 'compset' member

2 years agoglcomp: remove unused 'C_DPI', 'R_DPI'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
glcomp: remove unused 'C_DPI', 'R_DPI'

The last uses of these were removed in 8444026daa5f5ba70dcc2a719f9ad23b927e88ce.

2 years agoglcomp: remove unused 'FONT_MAX_LEN'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
glcomp: remove unused 'FONT_MAX_LEN'

The last use of this was removed in ed74e24b8020a70678d05489639e0e8c4574f87d.

2 years agoglcomp: remove unused 'FONT_TAB_SPACE'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
glcomp: remove unused 'FONT_TAB_SPACE'

The last use of this was removed in 8444026daa5f5ba70dcc2a719f9ad23b927e88ce.

2 years agoglcomp: remove unused 'GLCOMPSET_DEFAULT_PAD'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
glcomp: remove unused 'GLCOMPSET_DEFAULT_PAD'

The last use of this was removed in 8444026daa5f5ba70dcc2a719f9ad23b927e88ce.

2 years agoglcomp: remove unused 'glCompTrackBar'
Matthew Fernandez [Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)]
glcomp: remove unused 'glCompTrackBar'

The last use of this was removed in 8444026daa5f5ba70dcc2a719f9ad23b927e88ce. We
also remove `glCompOrientation` which was only used within this struct.

2 years agoMerge branch 'smattr/e78584c4-bddc-43a8-8d67-715eb74454c9' into 'main'
Matthew Fernandez [Tue, 11 Oct 2022 01:40:17 +0000 (01:40 +0000)]
Merge branch 'smattr/e78584c4-bddc-43a8-8d67-715eb74454c9' into 'main'

neatogen: progress on using cgraph wrappers for allocation

See merge request graphviz/graphviz!2885

2 years agoneatogen print_bounding_box: use cgraph wrappers for allocation
Matthew Fernandez [Fri, 7 Oct 2022 02:37:52 +0000 (19:37 -0700)]
neatogen print_bounding_box: use cgraph wrappers for allocation

The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.

2 years agoneatogen OverlapSmoother_new: use cgraph wrappers for allocation
Matthew Fernandez [Fri, 7 Oct 2022 02:37:07 +0000 (19:37 -0700)]
neatogen OverlapSmoother_new: use cgraph wrappers for allocation

The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.

2 years agoneatogen relative_position_constraints_new: use cgraph wrapper for allocation
Matthew Fernandez [Fri, 7 Oct 2022 02:36:26 +0000 (19:36 -0700)]
neatogen relative_position_constraints_new: use cgraph wrapper for allocation

The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.

2 years agoneatogen get_overlap_graph: use cgraph wrappers for allocation
Matthew Fernandez [Fri, 7 Oct 2022 02:35:41 +0000 (19:35 -0700)]
neatogen get_overlap_graph: use cgraph wrappers for allocation

The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.