|
Graphviz
2.29.20120524.0446
|
00001 /* $Id$ $Revision$ */ 00002 /* vim:set shiftwidth=4 ts=8: */ 00003 00004 /************************************************************************* 00005 * Copyright (c) 2011 AT&T Intellectual Property 00006 * All rights reserved. This program and the accompanying materials 00007 * are made available under the terms of the Eclipse Public License v1.0 00008 * which accompanies this distribution, and is available at 00009 * http://www.eclipse.org/legal/epl-v10.html 00010 * 00011 * Contributors: See CVS logs. Details at http://www.graphviz.org/ 00012 *************************************************************************/ 00013 00014 #ifndef GVC_H 00015 #define GVC_H 00016 00017 #include "types.h" 00018 #include "gvplugin.h" 00019 00020 #ifdef __cplusplus 00021 extern "C" { 00022 #endif 00023 00024 #ifdef GVDLL 00025 #define extern __declspec(dllexport) 00026 #else 00027 #define extern 00028 #endif 00029 00030 /*visual studio*/ 00031 #ifdef WIN32_DLL 00032 #ifndef GVC_EXPORTS 00033 #define extern __declspec(dllimport) 00034 #endif 00035 #endif 00036 /*end visual studio*/ 00037 00038 /* misc */ 00039 /* FIXME - this needs eliminating or renaming */ 00040 extern void gvToggle(int); 00041 00042 /* set up a graphviz context */ 00043 extern GVC_t *gvNEWcontext(const lt_symlist_t *builtins, int demand_loading); 00044 00045 /* set up a graphviz context - and init graph - retaining old API */ 00046 extern GVC_t *gvContext(void); 00047 /* set up a graphviz context - and init graph - with builtins */ 00048 extern GVC_t *gvContextPlugins(const lt_symlist_t *builtins, int demand_loading); 00049 00050 /* get information associated with a graphviz context */ 00051 extern char **gvcInfo(GVC_t*); 00052 extern char *gvcVersion(GVC_t*); 00053 extern char *gvcBuildDate(GVC_t*); 00054 00055 /* parse command line args - minimally argv[0] sets layout engine */ 00056 extern int gvParseArgs(GVC_t *gvc, int argc, char **argv); 00057 extern graph_t *gvNextInputGraph(GVC_t *gvc); 00058 extern graph_t *gvPluginsGraph(GVC_t *gvc); 00059 00060 /* Compute a layout using a specified engine */ 00061 extern int gvLayout(GVC_t *gvc, graph_t *g, const char *engine); 00062 00063 /* Compute a layout using layout engine from command line args */ 00064 extern int gvLayoutJobs(GVC_t *gvc, graph_t *g); 00065 00066 /* Render layout into string attributes of the graph */ 00067 extern void attach_attrs(graph_t *g); 00068 00069 /* Parse an html string */ 00070 #ifndef WITH_CGRAPH 00071 extern char *agstrdup_html(char *s); 00072 extern int aghtmlstr(char *s); 00073 #endif 00074 00075 /* Render layout in a specified format to an open FILE */ 00076 extern int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out); 00077 00078 /* Render layout in a specified format to an open FILE */ 00079 extern int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *filename); 00080 00081 /* Render layout in a specified format to an external context */ 00082 extern int gvRenderContext(GVC_t *gvc, graph_t *g, const char *format, void *context); 00083 00084 /* Render layout in a specified format to a malloc'ed string */ 00085 extern int gvRenderData(GVC_t *gvc, graph_t *g, const char *format, char **result, unsigned int *length); 00086 00087 /* Render layout according to -T and -o options found by gvParseArgs */ 00088 extern int gvRenderJobs(GVC_t *gvc, graph_t *g); 00089 00090 /* Clean up layout data structures - layouts are not nestable (yet) */ 00091 extern int gvFreeLayout(GVC_t *gvc, graph_t *g); 00092 00093 /* Clean up graphviz context */ 00094 extern void gvFinalize(GVC_t *gvc); 00095 extern int gvFreeContext(GVC_t *gvc); 00096 00097 /* Return list of plugins of type kind. 00098 * kind would normally be "render" "layout" "textlayout" "device" "loadimage" 00099 * The size of the list is stored in sz. 00100 * The caller is responsible for freeing the storage. This involves 00101 * freeing each item, then the list. 00102 * Returns NULL on error, or if there are no plugins. 00103 * In the former case, sz is unchanged; in the latter, sz = 0. 00104 * 00105 * At present, the str argument is unused, but may be used to modify 00106 * the search as in gvplugin_list above. 00107 */ 00108 extern char** gvPluginList (GVC_t *gvc, char* kind, int* sz, char*); 00109 00118 extern void gvAddLibrary(GVC_t *gvc, gvplugin_library_t *lib); 00119 00120 #undef extern 00121 00122 #ifdef __cplusplus 00123 } 00124 #endif 00125 00126 #endif /* GVC_H */
1.7.5