- **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**: The `textlayout` member of the `gvtextlayout_engine_t` struct
+ must now return a C99 `bool` instead of a Graphviz-specific `boolean`.
- **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
#include "gvplugin.h"
#include "gvcjob.h"
#include "gvcommon.h"
+#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
struct gvtextlayout_engine_s {
- boolean (*textlayout) (textspan_t *span, char** fontpath);
+ bool (*textlayout) (textspan_t *span, char** fontpath);
};
#ifdef __cplusplus
gvtextlayout_engine_t *gvte = gvc->textlayout.engine;
if (gvte && gvte->textlayout)
- return gvte->textlayout(span, fontpath) != FALSE;
+ return gvte->textlayout(span, fontpath);
return false;
}
#include "config.h"
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
return buf;
}
-static boolean gd_textlayout(textspan_t * span, char **fontpath)
+static bool gd_textlayout(textspan_t * span, char **fontpath)
{
char *err, *fontlist, *fontname;
double fontsize;
if (fontname) {
if (fontsize <= FONTSIZE_MUCH_TOO_SMALL) {
- return TRUE; /* OK, but ignore text entirely */
+ return true; /* OK, but ignore text entirely */
} else if (fontsize <= FONTSIZE_TOO_SMALL) {
/* draw line in place of text */
/* fake a finite fontsize so that line length is calculated */
if (err) {
agerr(AGERR,"%s\n", err);
- return FALSE; /* indicate error */
+ return false; /* indicate error */
}
if (fontpath)
span->size.y = (int)(fontsize * 1.2);
}
}
- return TRUE;
+ return true;
}
static gvtextlayout_engine_t gd_textlayout_engine = {
delete reinterpret_cast<Layout*>(layout);
};
-boolean gdiplus_textlayout(textspan_t *span, char **)
+bool gdiplus_textlayout(textspan_t *span, char **)
{
/* ensure GDI+ is started up: since we get called outside of a job, we can't rely on GDI+ startup then */
UseGdiplus();
span->size.y = layout->font->GetHeight(&measureGraphics);
span->yoffset_layout = fontFamily.GetCellAscent(style) * span->font->size / fontFamily.GetEmHeight(style); /* convert design units to pixels */
span->yoffset_centerline = 0;
- return TRUE;
+ return true;
};
static gvtextlayout_engine_t gdiplus_textlayout_engine = {
#include <assert.h>
#include <limits.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <gvc/gvplugin_render.h>
return (int)len;
}
-static boolean pango_textlayout(textspan_t * span, char **fontpath)
+static bool pango_textlayout(textspan_t * span, char **fontpath)
{
static char buf[1024]; /* returned in fontpath, only good until next call */
static PangoFontMap *fontmap;
/* check if the conversion to Pango units below will overflow */
if ((double)(G_MAXINT / PANGO_SCALE) < span->font->size) {
- return FALSE;
+ return false;
}
free(fontname);
/* The distance below midline for y centering of text strings */
span->yoffset_centerline = 0.2 * span->font->size;
- if (logical_rect.width == 0)
- return FALSE;
- return TRUE;
+ return logical_rect.width != 0;
}
static gvtextlayout_engine_t pango_textlayout_engine = {
#include "config.h"
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#endif
-boolean quartz_textlayout(textspan_t *para, char **fontpath)
+bool quartz_textlayout(textspan_t *para, char **fontpath)
{
void *line = quartz_new_layout(para->font->name, para->font->size, para->str);
if (line)
para->free_layout = &quartz_free_layout;
quartz_size_layout((void*)line, ¶->size.x, ¶->size.y, ¶->yoffset_layout);
para->yoffset_centerline = 0.2 * para->font->size;
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
};
static gvtextlayout_engine_t quartz_textlayout_engine = {