From d2e69c614ddbe518eca843586b56bffb98cb461a Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 15 Jan 2022 15:45:31 -0800 Subject: [PATCH] API BREAK: use a C99 bool for 'GVJ_t.external_context' --- CHANGELOG.md | 4 ++-- lib/gvc/gvc.c | 2 +- lib/gvc/gvcjob.h | 2 +- plugin.demo/xgtk/src/callbacks.c | 5 +++-- plugin/glitz/gvdevice_glitz.c | 2 +- plugin/gtk/callbacks.c | 5 +++-- plugin/xlib/gvdevice_xlib.c | 2 +- tclpkg/tcldot/tcldot-graphcmd.c | 3 ++- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfbeb19a3..58d9dfdd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,8 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 C99 `bool` instead of a Graphviz-specific `boolean`. - **Breaking**: The `must_inline` and `nocache` fields of the `usershape_t` struct are now C99 `bool`s instead of Graphviz-specific `boolean`s. -- **Breaking**: The `device_sets_dpi` field of the `GVJ_t` struct is now a C99 - `bool` instead of a Graphviz-specific `boolean`. +- **Breaking**: The `device_sets_dpi` and `external_context` fields of the + `GVJ_t` struct are now C99 `bool`s instead of Graphviz-specific `boolean`s. - **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 diff --git a/lib/gvc/gvc.c b/lib/gvc/gvc.c index 8bb185f46..1df28de13 100644 --- a/lib/gvc/gvc.c +++ b/lib/gvc/gvc.c @@ -166,7 +166,7 @@ int gvRenderContext(GVC_t *gvc, graph_t *g, const char *format, void *context) } job->context = context; - job->external_context = TRUE; + job->external_context = true; rc = gvRenderJobs(gvc, g); gvrender_end_job(job); diff --git a/lib/gvc/gvcjob.h b/lib/gvc/gvcjob.h index 00cceacfe..5bfd6f651 100644 --- a/lib/gvc/gvcjob.h +++ b/lib/gvc/gvcjob.h @@ -299,7 +299,7 @@ extern "C" { int screen; void *context; /* gd or cairo surface */ - boolean external_context; /* context belongs to caller */ + bool external_context; /* context belongs to caller */ char *imagedata; /* location of imagedata */ int flags; /* emit_graph flags */ diff --git a/plugin.demo/xgtk/src/callbacks.c b/plugin.demo/xgtk/src/callbacks.c index ae235deb0..06435185b 100644 --- a/plugin.demo/xgtk/src/callbacks.c +++ b/plugin.demo/xgtk/src/callbacks.c @@ -11,6 +11,7 @@ #include "config.h" #include +#include #include "gvplugin_device.h" @@ -210,7 +211,7 @@ on_drawingarea1_expose_event (GtkWidget *widget, (job->callbacks->motion)(job, job->pointer); job->context = (void *)cr; - job->external_context = TRUE; + job->external_context = true; job->width = widget->allocation.width; job->height = widget->allocation.height; if (job->has_been_rendered) { @@ -275,7 +276,7 @@ on_drawingarea2_expose_event (GtkWidget *widget, (job->callbacks->motion)(job, job->pointer); job->context = (void *)cr; - job->external_context = TRUE; + job->external_context = true; job->width = widget->allocation.width; job->height = widget->allocation.height; diff --git a/plugin/glitz/gvdevice_glitz.c b/plugin/glitz/gvdevice_glitz.c index 079cdc9a7..09b6b3c08 100644 --- a/plugin/glitz/gvdevice_glitz.c +++ b/plugin/glitz/gvdevice_glitz.c @@ -254,7 +254,7 @@ static void update_display(GVJ_t *job, Display *dpy) window->pix, window->visual, job->width, job->height); job->context = (void *)cairo_create(surface); - job->external_context = TRUE; + job->external_context = true; (job->callbacks->refresh)(job); cairo_surface_destroy(surface); XCopyArea(dpy, window->pix, window->win, window->gc, diff --git a/plugin/gtk/callbacks.c b/plugin/gtk/callbacks.c index 6dfe15de2..53d4f7d39 100644 --- a/plugin/gtk/callbacks.c +++ b/plugin/gtk/callbacks.c @@ -11,6 +11,7 @@ #include "config.h" #include +#include #include @@ -211,7 +212,7 @@ on_drawingarea1_expose_event (GtkWidget *widget, (job->callbacks->motion)(job, job->pointer); job->context = cr; - job->external_context = TRUE; + job->external_context = true; job->width = widget->allocation.width; job->height = widget->allocation.height; if (job->has_been_rendered) { @@ -276,7 +277,7 @@ on_drawingarea2_expose_event (GtkWidget *widget, (job->callbacks->motion)(job, job->pointer); job->context = cr; - job->external_context = TRUE; + job->external_context = true; job->width = widget->allocation.width; job->height = widget->allocation.height; diff --git a/plugin/xlib/gvdevice_xlib.c b/plugin/xlib/gvdevice_xlib.c index c29f6024f..78cc13528 100644 --- a/plugin/xlib/gvdevice_xlib.c +++ b/plugin/xlib/gvdevice_xlib.c @@ -242,7 +242,7 @@ static void update_display(GVJ_t *job, Display *dpy) window->pix, window->visual, job->width, job->height); job->context = (void *)cairo_create(surface); - job->external_context = TRUE; + job->external_context = true; (job->callbacks->refresh)(job); cairo_surface_destroy(surface); XCopyArea(dpy, window->pix, window->win, window->gc, diff --git a/tclpkg/tcldot/tcldot-graphcmd.c b/tclpkg/tcldot/tcldot-graphcmd.c index d902b201a..e7ee1deae 100644 --- a/tclpkg/tcldot/tcldot-graphcmd.c +++ b/tclpkg/tcldot/tcldot-graphcmd.c @@ -8,6 +8,7 @@ * Contributors: Details at https://graphviz.org *************************************************************************/ +#include #include "tcldot.h" int graphcmd(ClientData clientData, Tcl_Interp * interp, @@ -337,7 +338,7 @@ int graphcmd(ClientData clientData, Tcl_Interp * interp, job = gvc->job; job->imagedata = canvas; job->context = interp; - job->external_context = TRUE; + job->external_context = true; job->output_file = stdout; /* make sure that layout is done */ -- 2.40.0