00001 /* $Id: gvcint.h,v 1.75 2008/02/22 14:31:36 glenlow Exp $ $Revision: 1.75 $ */ 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 /* Common header used by both clients and plugins */ 00018 00019 #ifndef GVCINT_H 00020 #define GVCINT_H 00021 00022 #ifdef __cplusplus 00023 extern "C" { 00024 #endif 00025 00026 #include "gvcommon.h" 00027 #include "color.h" 00028 00029 /* active plugin headers */ 00030 typedef struct gvplugin_active_layout_s { 00031 gvlayout_engine_t *engine; 00032 int id; 00033 gvlayout_features_t *features; 00034 char *type; 00035 } gvplugin_active_layout_t; 00036 00037 typedef struct gvplugin_active_textlayout_s { 00038 gvtextlayout_engine_t *engine; 00039 int id; 00040 char *type; 00041 } gvplugin_active_textlayout_t; 00042 00043 typedef struct gvplugin_available_s gvplugin_available_t; 00044 00045 struct gvplugin_available_s { 00046 gvplugin_available_t *next; /* next plugin in linked list, or NULL */ 00047 char *typestr; /* type string, e.g. "png" or "ps" */ 00048 int quality; /* programmer assigned quality 00049 ranking within type (+ve or -ve int) 00050 - codegens have quality = 0 */ 00051 char *path; /* file path to library containing plugin, 00052 or NULL if builtin */ 00053 char *packagename; /* package name */ 00054 gvplugin_installed_t *typeptr; /* pointer to jumptable for plugin, 00055 or NULL if not yet loaded */ 00056 }; 00057 00058 typedef struct GVG_s GVG_t; 00059 00060 struct GVG_s { 00061 GVC_t *gvc; /* parent gvc */ 00062 GVG_t *next; /* next gvg in list */ 00063 00064 char *input_filename; /* or NULL if stdin */ 00065 int graph_index; /* index of graph within input_file */ 00066 graph_t *g; 00067 }; 00068 00069 #define MAXNEST 4 00070 00071 struct GVC_s { 00072 GVCOMMON_t common; 00073 00074 char *config_path; 00075 boolean config_found; 00076 00077 /* gvParseArgs */ 00078 char **input_filenames; /* null terminated array of input filenames */ 00079 00080 /* gvNextInputGraph() */ 00081 GVG_t *gvgs; /* linked list of graphs */ 00082 GVG_t *gvg; /* current graph */ 00083 00084 /* plugins */ 00085 #define ELEM(x) +1 00086 /* APIS expands to "+1 +1 ... +1" to give the number of APIs */ 00087 gvplugin_available_t *apis[ APIS ]; /* array of linked-list of plugins per api */ 00088 gvplugin_available_t *api[ APIS ]; /* array of current plugins per api */ 00089 #undef ELEM 00090 00091 /* keybindings for keyboard events */ 00092 gvevent_key_binding_t *keybindings; 00093 int numkeys; 00094 void *keycodes; 00095 00096 /* externally provided write() displine */ 00097 size_t (*write_fn) (const char *s, int len); 00098 00099 /* FIXME - everything below should probably move to GVG_t */ 00100 00101 /* gvrender_config() */ 00102 GVJ_t *jobs; /* linked list of jobs */ 00103 GVJ_t *job; /* current job */ 00104 00105 graph_t *g; /* current graph */ 00106 00107 /* gvrender_begin_job() */ 00108 gvplugin_active_textlayout_t textlayout; 00109 gvplugin_active_layout_t layout; 00110 00111 char *graphname; /* name from graph */ 00112 GVJ_t *active_jobs; /* linked list of active jobs */ 00113 00114 /* pagination */ 00115 char *pagedir; /* pagination order */ 00116 pointf margin; /* margins in graph units */ 00117 pointf pad; /* pad in graph units */ 00118 pointf pageSize; /* pageSize in graph units, not including margins */ 00119 point pb; /* page size - including margins (inches) */ 00120 boxf bb; /* graph bb in graph units, not including margins */ 00121 int rotation; /* rotation - 0 = portrait, 90 = landscape */ 00122 boolean graph_sets_pad, graph_sets_margin, graph_sets_pageSize, graph_sets_rotation; 00123 00124 /* layers */ 00125 char *layerDelims; /* delimiters in layer names */ 00126 char *layers; /* null delimited list of layer names */ 00127 char **layerIDs; /* array of layer names */ 00128 int numLayers; /* number of layers */ 00129 00130 /* default font */ 00131 char *defaultfontname; 00132 double defaultfontsize; 00133 00134 /* default line style */ 00135 char **defaultlinestyle; 00136 00137 /* render defaults set from graph */ 00138 gvcolor_t bgcolor; /* background color */ 00139 00140 /* whether to mangle font names (at least in SVG), usually false */ 00141 int fontrenaming; 00142 }; 00143 00144 #ifdef WIN32 00145 #define DIRSEP "\\" 00146 #else 00147 #define DIRSEP "/" 00148 #endif 00149 00150 #ifdef __cplusplus 00151 } 00152 #endif 00153 #endif /* GVCINT_H */