/misc/src/release/graphviz-2.18-1/src/graphviz-2.18/lib/gvc/gvloadimage.c

Go to the documentation of this file.
00001 /* $Id: gvloadimage.c,v 1.6 2007/09/07 20:28:24 ellson Exp $ $Revision: 1.6 $ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /**********************************************************
00005 *      This software is part of the graphviz package      *
00006 *                http://www.graphviz.org/                 *
00007 *                                                         *
00008 *            Copyright (c) 1994-2004 AT&T Corp.           *
00009 *                and is licensed under the                *
00010 *            Common Public License, Version 1.0           *
00011 *                      by AT&T Corp.                      *
00012 *                                                         *
00013 *        Information and Software Systems Research        *
00014 *              AT&T Research, Florham Park NJ             *
00015 **********************************************************/
00016 
00017 /*
00018  *  graphics code generator wrapper
00019  *
00020  *  This library forms the socket for run-time loadable loadimage plugins.  
00021  */
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026 
00027 #include <string.h>
00028 
00029 #include "const.h"
00030 #include "gvplugin_loadimage.h"
00031 #include "gvcint.h"
00032 #include "gvcproc.h"
00033 
00034 /* for agerr() */
00035 #include "graph.h"
00036 
00037 static int gvloadimage_select(GVJ_t * job, char *str)
00038 {
00039     gvplugin_available_t *plugin;
00040     gvplugin_installed_t *typeptr;
00041 
00042     plugin = gvplugin_load(job->gvc, API_loadimage, str);
00043     if (plugin) {
00044         typeptr = plugin->typeptr;
00045         job->loadimage.engine = (gvloadimage_engine_t *) (typeptr->engine);
00046         job->loadimage.id = typeptr->id;
00047         return GVRENDER_PLUGIN;
00048     }
00049     return NO_SUPPORT;
00050 }
00051 
00052 void gvloadimage(GVJ_t * job, usershape_t *us, boxf b, boolean filled, char *target)
00053 {
00054     gvloadimage_engine_t *gvli;
00055     char type[SMALLBUF];
00056 
00057     strcpy(type, us->stringtype);
00058     strcat(type, ":");
00059     strcat(type, target);
00060 
00061     if (gvloadimage_select(job, type) == NO_SUPPORT)
00062             agerr (AGWARN, "No loadimage plugin for \"%s\"\n", type);
00063 
00064     if ((gvli = job->loadimage.engine) && gvli->loadimage)
00065         gvli->loadimage(job, us, b, filled);
00066 }

Generated on Mon Mar 31 19:03:26 2008 for Graphviz by  doxygen 1.5.1