From: ellson Date: Wed, 6 Jul 2005 16:04:22 +0000 (+0000) Subject: fix build breakage and add some more details to usershape plugin X-Git-Tag: LAST_LIBGRAPH~32^2~7473 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=192a63b9d8ebd6217f1a47760602936ff28dc136;p=graphviz fix build breakage and add some more details to usershape plugin --- diff --git a/lib/gvc/Makefile.am b/lib/gvc/Makefile.am index 7a29c1429..01be4fe28 100644 --- a/lib/gvc/Makefile.am +++ b/lib/gvc/Makefile.am @@ -11,10 +11,11 @@ AM_CPPFLAGS = \ LIBS = $(LIBLTDL) $(SOCKET_LIBS) pkginclude_HEADERS = gvc.h gvcint.h gvplugin.h \ - gvplugin_render.h gvplugin_layout.h gvplugin_textlayout.h gvplugin_device.h + gvplugin_render.h gvplugin_layout.h gvplugin_textlayout.h \ + gvplugin_device.h gvplugin_usershape.h pkglib_LTLIBRARIES = libgvc.la libgvc_la_SOURCES = gvrender.c gvlayout.c gvtextlayout.c gvdevice.c \ - gvcontext.c gvjobs.c gvevent.c gvplugin.c gvconfig.c + gvcontext.c gvjobs.c gvevent.c gvplugin.c gvconfig.c gvusershape.c EXTRA_DIST = Makefile.old diff --git a/lib/gvc/Makefile.old b/lib/gvc/Makefile.old index c77678279..f05fb3fea 100644 --- a/lib/gvc/Makefile.old +++ b/lib/gvc/Makefile.old @@ -14,10 +14,11 @@ INCS = -I. \ DEFINES = -DHAVE_CONFIG_H -DGVLIBDIR=$(LIBDIR) HDRS = gvc.h gvcint.h gvplugin_render.h gvplugin_device.h \ - gvplugin_layout.h gvplugin_textlayout.h gvplugin.h + gvplugin_layout.h gvplugin_textlayout.h \ + gvplugin_usershape.h gvplugin.h OBJS = gvrender.o gvlayout.o gvdevice.o gvcontext.o gvjobs.o \ - gvplugin.o gvconfig.o gvevent.o gvtextlayout.o + gvplugin.o gvconfig.o gvevent.o gvtextlayout.o gvusershape.o libgvc.a : $(OBJS) $(RM) libgvc.a diff --git a/lib/gvc/gvc.h b/lib/gvc/gvc.h index 5022a9e08..df6c12057 100644 --- a/lib/gvc/gvc.h +++ b/lib/gvc/gvc.h @@ -58,12 +58,18 @@ extern "C" { /* emit */ extern void gvemit_graph(GVC_t * gvc, graph_t * g); -/* text_layout */ +/* textlayout */ - extern int gvtext_select(GVC_t * gvc, char *text_layout); - extern double gvtext_width(GVC_t *gvc, textline_t *textline, - char *fontname, double fontsize, - char *fontpath); + extern int gvtextlayout_select(GVC_t * gvc, char *textlayout); + extern double gvtextlayout_width(GVC_t *gvc, textline_t *textline, + char *fontname, double fontsize, char *fontpath); + +/* usershape */ + + extern int gvusershape_select(GVC_t * gvc, char *name); + extern void * gvusershape_getshape(GVC_t * gvc, char *usershape); + extern void gvusershape_freeeshapes(GVC_t * gvc); + extern point gvusershape_imagesize(GVC_t * gvc, char *usershape); /* device */ diff --git a/lib/gvc/gvcint.h b/lib/gvc/gvcint.h index e66b78996..66f0bdf06 100644 --- a/lib/gvc/gvcint.h +++ b/lib/gvc/gvcint.h @@ -200,12 +200,14 @@ extern "C" { gv_plugin_t *api[ APIS ]; /* array of current plugins per api */ #undef ELEM - gvtextlayout_engine_t *textlayout_engine; /* current text_layout engine */ + gvtextlayout_engine_t *textlayout_engine; /* current textlayout engine */ + gvusershape_engine_t *usershape_engine; /* current usershape engine */ /* gvrender_begin_job() */ char *layout_type; /* string name of layout type */ gvlayout_engine_t *layout_engine; /* current layout engine */ int layout_id; /* internal id of current layout */ + char *graphname; /* name from graph */ GVJ_t *active_jobs; /* linked list of active jobs */ diff --git a/lib/gvc/gvtextlayout.c b/lib/gvc/gvtextlayout.c index 2178d7cba..9d53d44c9 100644 --- a/lib/gvc/gvtextlayout.c +++ b/lib/gvc/gvtextlayout.c @@ -15,7 +15,7 @@ **********************************************************/ /* - * text_layout engine wrapper + * textlayout engine wrapper */ #ifdef HAVE_CONFIG_H @@ -31,21 +31,21 @@ #include "gvplugin_textlayout.h" #include "gvc.h" -int gvtext_select(GVC_t * gvc, char *text_layout) +int gvtextlayout_select(GVC_t * gvc, char *textlayout) { gv_plugin_t *plugin; gvplugin_type_t *typeptr; - plugin = gvplugin_load(gvc, API_textlayout, text_layout); + plugin = gvplugin_load(gvc, API_textlayout, textlayout); if (plugin) { typeptr = plugin->typeptr; - gvc->layout_engine = (gvlayout_engine_t *) (typeptr->engine); + gvc->textlayout_engine = (gvtextlayout_engine_t *) (typeptr->engine); return GVRENDER_PLUGIN; /* FIXME - need more suitable success code */ } return NO_SUPPORT; } -double gvtext_width(GVC_t *gvc, textline_t *textline, char *fontname, double fontsize, char *fontpath) +double gvtextlayout_width(GVC_t *gvc, textline_t *textline, char *fontname, double fontsize, char *fontpath) { gvtextlayout_engine_t *gvte = gvc->textlayout_engine; diff --git a/lib/gvc/gvusershape.c b/lib/gvc/gvusershape.c new file mode 100644 index 000000000..6044ba5cd --- /dev/null +++ b/lib/gvc/gvusershape.c @@ -0,0 +1,46 @@ +/* $Id$ $Revision$ */ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + +/* + * usershape engine wrapper + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "const.h" +#include "types.h" +#include "macros.h" + +#include "gvplugin_usershape.h" +#include "gvc.h" + +int gvusershape_select(GVC_t * gvc, char *usershape) +{ + gv_plugin_t *plugin; + gvplugin_type_t *typeptr; + + plugin = gvplugin_load(gvc, API_usershape, usershape); + if (plugin) { + typeptr = plugin->typeptr; + gvc->usershape_engine = (gvusershape_engine_t *) (typeptr->engine); + return GVRENDER_PLUGIN; /* FIXME - need more suitable success code */ + } + return NO_SUPPORT; +}