]> granicus.if.org Git - graphviz/commitdiff
fix build breakage and add some more details to usershape plugin
authorellson <devnull@localhost>
Wed, 6 Jul 2005 16:04:22 +0000 (16:04 +0000)
committerellson <devnull@localhost>
Wed, 6 Jul 2005 16:04:22 +0000 (16:04 +0000)
lib/gvc/Makefile.am
lib/gvc/Makefile.old
lib/gvc/gvc.h
lib/gvc/gvcint.h
lib/gvc/gvtextlayout.c
lib/gvc/gvusershape.c [new file with mode: 0644]

index 7a29c1429ab10d1a9dcd09ab4773c34f692fcb1d..01be4fe28d913f9d4030932a840e370e7cc7ab91 100644 (file)
@@ -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
index c7767827905caead97c2da2d7192d592f6128c9d..f05fb3fea2444fd567f8eff8fc55e8f0f5cacb3a 100644 (file)
@@ -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
index 5022a9e08df68c7aaacc79a9fb8be64260ec2f18..df6c12057b3fbb0972363311d1a3b456d2fff176 100644 (file)
@@ -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 */
 
index e66b7899632beea1b78312fc6fc9e1403ba20b64..66f0bdf06a39363f840bbf6111112c6b071d2150 100644 (file)
@@ -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 */
 
index 2178d7cba9ffefd36cfdd8071f8b40e50b05a086..9d53d44c9400dd8d0db30083d96fa6cee8c232b4 100644 (file)
@@ -15,7 +15,7 @@
 **********************************************************/
 
 /*
- *  text_layout engine wrapper
+ *  textlayout engine wrapper
  */
 
 #ifdef HAVE_CONFIG_H
 #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 (file)
index 0000000..6044ba5
--- /dev/null
@@ -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 <stdio.h>
+
+#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;
+}