]> granicus.if.org Git - graphviz/commitdiff
API BREAK: take a C99 bool in 'gvloadimage_engine_t.loadimage'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 Jan 2022 00:08:12 +0000 (16:08 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 Jan 2022 17:48:19 +0000 (09:48 -0800)
15 files changed:
CHANGELOG.md
lib/gvc/gvloadimage.c
lib/gvc/gvplugin_loadimage.h
plugin/core/gvloadimage_core.c
plugin/core/gvrender_core_dot.c
plugin/gd/gvloadimage_gd.c
plugin/gdiplus/gvloadimage_gdiplus.cpp
plugin/gdk/gvloadimage_gdk.c
plugin/gs/gvloadimage_gs.c
plugin/lasi/gvloadimage_lasi.c
plugin/pango/gvloadimage_pango.c
plugin/poppler/gvloadimage_poppler.c
plugin/quartz/gvloadimage_quartz.c
plugin/rsvg/gvloadimage_rsvg.c
plugin/webp/gvloadimage_webp.c

index 85f32981320a223b067ba4f524fcea3e1711b006..6bdfb3a642caa60cc35c070a29ebca4640507c81 100644 (file)
@@ -40,6 +40,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - **Breaking**: The `device_sets_dpi`, `external_context`, `fit_mode`,
   `needs_refresh`, `click`, `has_grown`, and `has_been_rendered` fields of the
   `GVJ_t` struct are now C99 `bool`s instead of Graphviz-specific `boolean`s.
+- **Breaking**: The `loadimage` member of the `gvloadimage_engine_t` struct must
+  now accept a C99 `bool` parameter instead of a former Graphviz-specific
+  `boolean` parameter.
 - **Breaking**: 1-bit fields of the `obj_state_s` struct are now unsigned
   instead of signed.
 - **Breaking**: Graphviz headers no longer define the constant `MAXSHORT`. A
index bb8e52691781cd8d6cf6a95c2918b45f33257255..d4f34d6028d9282a5a2954382e52934c0b87d470 100644 (file)
@@ -60,5 +60,5 @@ void gvloadimage(GVJ_t * job, usershape_t *us, boxf b, bool filled, const char *
            agerr (AGWARN, "No loadimage plugin for \"%s\"\n", type);
 
     if ((gvli = job->loadimage.engine) && gvli->loadimage)
-       gvli->loadimage(job, us, b, filled ? TRUE : FALSE);
+       gvli->loadimage(job, us, b, filled);
 }
index 144c1e80fcc8b5214a2344c7c9102e48458cb4ff..4f496e2832c5cbe9bef08e1e936edafc624f2863 100644 (file)
@@ -13,6 +13,7 @@
 #include "types.h"
 #include "gvplugin.h"
 #include "gvcjob.h"
+#include <stdbool.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -34,7 +35,7 @@ GVPLUGIN_LOADIMAGE_API boolean gvusershape_file_access(usershape_t *us);
 GVPLUGIN_LOADIMAGE_API void gvusershape_file_release(usershape_t *us);
 
     struct gvloadimage_engine_s {
-       void (*loadimage) (GVJ_t *job, usershape_t *us, boxf b, boolean filled);
+       void (*loadimage) (GVJ_t *job, usershape_t *us, boxf b, bool filled);
     };
 
 #undef GVPLUGIN_LOADIMAGE_API
index 66982eb3502709eae2f2422830d70b2ff9a78e67..f8b7ddd365222f96e47ecbcb901907bd46342988 100644 (file)
@@ -26,7 +26,7 @@
 #include <common/utils.h>
 #include <gvc/gvio.h>
 
-extern void core_loadimage_xdot(GVJ_t*, usershape_t*, boxf, boolean);
+extern void core_loadimage_xdot(GVJ_t*, usershape_t*, boxf, bool);
 extern shape_desc *find_user_shape(char *name);
 
 typedef enum {
@@ -41,7 +41,7 @@ typedef enum {
     FORMAT_GIF_TK,
 } format_type;
 
-static void core_loadimage_svg(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void core_loadimage_svg(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     (void)filled;
 
@@ -71,7 +71,7 @@ static void core_loadimage_svg(GVJ_t * job, usershape_t *us, boxf b, boolean fil
     gvputs(job, "/>\n");
 }
 
-static void core_loadimage_fig(GVJ_t * job, usershape_t *us, boxf bf, boolean filled)
+static void core_loadimage_fig(GVJ_t * job, usershape_t *us, boxf bf, bool filled)
 {
     (void)filled;
 
@@ -114,7 +114,7 @@ static void core_loadimage_fig(GVJ_t * job, usershape_t *us, boxf bf, boolean fi
            b.LL.x, b.LL.y);
 }
 
-static void core_loadimage_vrml(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void core_loadimage_vrml(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     (void)b;
     (void)filled;
@@ -152,7 +152,7 @@ static void ps_freeimage(usershape_t *us)
 }
 
 /* usershape described by a postscript file */
-static void core_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void core_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     (void)filled;
 
@@ -211,7 +211,7 @@ static void core_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean fill
 }
 
 /* usershape described by a member of a postscript library */
-static void core_loadimage_pslib(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void core_loadimage_pslib(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     int i;
     pointf AF[4];
@@ -243,7 +243,7 @@ static void core_loadimage_pslib(GVJ_t * job, usershape_t *us, boxf b, boolean f
     }
 }
 
-static void core_loadimage_vml(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void core_loadimage_vml(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     (void)filled;
 
@@ -254,7 +254,7 @@ static void core_loadimage_vml(GVJ_t * job, usershape_t *us, boxf b, boolean fil
     gvputs(job, " />\n");
 }
 
-static void core_loadimage_tk(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void core_loadimage_tk(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     (void)filled;
 
@@ -264,7 +264,7 @@ static void core_loadimage_tk(GVJ_t * job, usershape_t *us, boxf b, boolean fill
        us->name, (b.UR.x + b.LL.x) / 2, (b.UR.y + b.LL.y) / 2);
 }
 
-static void core_loadimage_null(GVJ_t *gvc, usershape_t *us, boxf b, boolean filled)
+static void core_loadimage_null(GVJ_t *gvc, usershape_t *us, boxf b, bool filled)
 {
     /* null function - basically suppress the missing loader message */
     (void)gvc;
index e3ac55545b9a8cfaf2d6683bba2f2c19303842d5..c6af89d9f14f746c56cd6623e03b53f6a91f9bba 100644 (file)
@@ -737,7 +737,7 @@ static void xdot_polyline(GVJ_t * job, pointf * A, int n)
     xdot_points(job, 'L', A, n);
 }
 
-void core_loadimage_xdot(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+void core_loadimage_xdot(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     (void)filled;
 
index 3666521a23342da2ab95ca34ccebfde7c0a6d78a..5afba5232381eb8d25506cbb2f7b72573fab0b13 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
@@ -87,7 +88,7 @@ static gdImagePtr gd_rotateimage(gdImagePtr im, int rotation)
     return im2;
 }
        
-static void gd_loadimage_gd(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void gd_loadimage_gd(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     gdImagePtr im2, im = (gdImagePtr) job->context;
 
@@ -100,7 +101,7 @@ static void gd_loadimage_gd(GVJ_t * job, usershape_t *us, boxf b, boolean filled
 }
 
 #ifdef HAVE_PANGOCAIRO
-static void gd_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void gd_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     cairo_t *cr = (cairo_t *) job->context; /* target context */
     unsigned int x, y, stride, width, height, px;
@@ -166,7 +167,7 @@ static void gd_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean fil
 }
 #endif
 
-static void gd_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void gd_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     gdImagePtr im = NULL;
     int X, Y, x, y, px;
index d54495d16bfa6924a3e07c7b7fba31d5ae1393c5..fc7859754532019b0ef4ac7b4a49aac7b1704483 100644 (file)
@@ -59,7 +59,7 @@ static Image* gdiplus_loadimage(GVJ_t * job, usershape_t *us)
     return reinterpret_cast<Image*>(us->data);
 }
 
-static void gdiplus_loadimage_gdiplus(GVJ_t * job, usershape_t *us, boxf b, boolean)
+static void gdiplus_loadimage_gdiplus(GVJ_t * job, usershape_t *us, boxf b, bool)
 {
        /* get the image from usershape details, then blit it to the context */
        Image *image = gdiplus_loadimage(job, us);
index 18cb01ae8a9ae9a19255e879a23dda90bfd16cc6..7a63230f999ef0788e306bb18afc4685d2913f42 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 
 #include <gvc/gvplugin_loadimage.h>
@@ -186,7 +187,7 @@ static cairo_surface_t* gdk_loadimage(GVJ_t * job, usershape_t *us)
 #endif /* HAVE_CAIRO_SURFACE_SET_MIME_DATA */
 }
 
-static void gdk_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void gdk_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     cairo_t *cr = (cairo_t *) job->context; /* target context */
 #ifndef HAVE_CAIRO_SURFACE_SET_MIME_DATA
index 6707e27a078df5e59c436a14f5cf0f3f51e79195..6ddb89da293d815988f15362b3e27b040a7cfd2a 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <sys/stat.h>
@@ -219,7 +220,7 @@ static cairo_pattern_t* gvloadimage_gs_load(GVJ_t * job, usershape_t *us)
     return gs->pattern;
 }
 
-static void gvloadimage_gs_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void gvloadimage_gs_cairo(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     cairo_t *cr = (cairo_t *) job->context; /* target context */
     cairo_pattern_t *pattern = gvloadimage_gs_load(job, us);
index cf06d5d17fa3442b25155f4d6f319183bac849e1..0d320726338f2b896f20bb5df9136a8cb48eb792 100644 (file)
@@ -42,7 +42,7 @@ static void ps_freeimage(usershape_t *us)
 }
 
 /* usershape described by a postscript file */
-static void lasi_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void lasi_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     assert(job);
     assert(us);
index 9e9100c5369bd581b8e3917765229cc915350b85..12440b977db62121324b7bbc3cbbd65ec66a12e6 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 
 #include <gvc/gvplugin_loadimage.h>
@@ -77,7 +78,7 @@ static cairo_surface_t* cairo_loadimage(GVJ_t * job, usershape_t *us)
     return surface;
 }
 
-static void pango_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void pango_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     cairo_t *cr = (cairo_t *) job->context; /* target context */
     cairo_surface_t *surface;   /* source surface */
@@ -101,7 +102,7 @@ static void pango_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean
     }
 }
 
-static void pango_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void pango_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     cairo_surface_t *surface;  /* source surface */
     cairo_format_t format;
index 948fa020104c7374c25cb27f0d393f64b045edd2..dcb9c73a68623b0e5e84ad67c9c8e0cf8311eaad 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <sys/stat.h>
 
@@ -104,7 +105,7 @@ static PopplerDocument* gvloadimage_poppler_load(GVJ_t * job, usershape_t *us)
     return document;
 }
 
-static void gvloadimage_poppler_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void gvloadimage_poppler_cairo(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     PopplerDocument* document = gvloadimage_poppler_load(job, us);
     PopplerPage* page;
index 1faf971414b410768456407c6a91b7e7947e9f9c..71cec5805fabbd71a081e08857c527cd6fb2823d 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
@@ -154,7 +155,7 @@ static CGImageRef quartz_loadimage(GVJ_t * job, usershape_t *us)
     return (CGImageRef)(us->data);
 }
 
-static void quartz_loadimage_quartz(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void quartz_loadimage_quartz(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
        /* get the image from usershape details, then blit it to the context */
        CGImageRef image = quartz_loadimage(job, us);
index 2dc34cf1fcafc00ee189d41b747f2a21317fb208..cfbeaf34a2fe322634dbe385f1880fe4beaa959b 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <sys/stat.h>
 
@@ -168,7 +169,7 @@ static RsvgHandle* gvloadimage_rsvg_load(GVJ_t * job, usershape_t *us)
     return rsvgh;
 }
 
-static void gvloadimage_rsvg_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void gvloadimage_rsvg_cairo(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     RsvgHandle* rsvgh = gvloadimage_rsvg_load(job, us);
 
index 670fba704f0ccb42ee131b5f9ab7c88a60041bf7..7b4c10153c90378188b21e27dbde99a008ab38a2 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -156,7 +157,7 @@ static cairo_surface_t* webp_loadimage(GVJ_t * job, usershape_t *us)
 }
 
 /* paint image into required location in graph */
-static void webp_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void webp_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
     cairo_t *cr = (cairo_t *) job->context; /* target context */
     cairo_surface_t *surface;   /* source surface */