Graphviz  2.41.20171026.1811
gvcint.h
Go to the documentation of this file.
1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 /* Common header used by both clients and plugins */
15 
16 #ifndef GVCINT_H
17 #define GVCINT_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include "cdt.h"
24 #include "gvcommon.h"
25 #include "color.h"
26 
27  /* active plugin headers */
28  typedef struct gvplugin_active_layout_s {
30  int id;
32  const char *type;
34 
37  int id;
38  char *type;
40 
42 
45  char *path;
46  char *name;
47  };
48 
50  gvplugin_available_t *next; /* next plugin in linked list, or NULL */
51  const char *typestr; /* type string, e.g. "png" or "ps" */
52  int quality; /* Programmer assigned quality ranking within type (+ve or -ve int).
53  First implementation of type should be given "0" quality */
54  gvplugin_package_t *package; /* details of library containing plugin */
55  gvplugin_installed_t *typeptr; /* pointer to jumptable for plugin,
56  or NULL if not yet loaded */
57  };
58 
59  struct GVG_s {
60  GVC_t *gvc; /* parent gvc */
61  GVG_t *next; /* next gvg in list */
62 
63  char *input_filename; /* or NULL if stdin */
64  int graph_index; /* index of graph within input_file */
66  };
67 
68 #define MAXNEST 4
69 
70  struct GVC_s {
72 
73  char *config_path;
74  boolean config_found;
75 
76  /* gvParseArgs */
77  char **input_filenames; /* null terminated array of input filenames */
78 
79  /* gvNextInputGraph() */
80  GVG_t *gvgs; /* linked list of graphs */
81  GVG_t *gvg; /* current graph */
82 
83  /* plugins */
84 #define ELEM(x) +1
85  /* APIS expands to "+1 +1 ... +1" to give the number of APIs */
86  gvplugin_available_t *apis[ APIS ]; /* array of linked-list of plugins per api */
87  gvplugin_available_t *api[ APIS ]; /* array of current plugins per api */
88 #undef ELEM
89  gvplugin_package_t *packages; /* list of available packages */
90 
91  /* externally provided write() displine */
92  size_t (*write_fn) (GVJ_t *job, const char *s, size_t len);
93 
94  /* fonts and textlayout */
97  gvplugin_active_textlayout_t textlayout; /* always use best avail for all jobs */
98 // void (*free_layout) (void *layout); /* function for freeing layouts (mostly used by pango) */
99 
100 /* FIXME - everything below should probably move to GVG_t */
101 
102  /* gvrender_config() */
103  GVJ_t *jobs; /* linked list of jobs */
104  GVJ_t *job; /* current job */
105 
106  graph_t *g; /* current graph */
107 
108  /* gvrender_begin_job() */
110 
111  char *graphname; /* name from graph */
112  GVJ_t *active_jobs; /* linked list of active jobs */
113 
114  /* pagination */
115  char *pagedir; /* pagination order */
116  pointf margin; /* margins in graph units */
117  pointf pad; /* pad in graph units */
118  pointf pageSize; /* pageSize in graph units, not including margins */
119  point pb; /* page size - including margins (inches) */
120  boxf bb; /* graph bb in graph units, not including margins */
121  int rotation; /* rotation - 0 = portrait, 90 = landscape */
123 
124  /* layers */
125  char *layerDelims; /* delimiters in layer names */
126  char *layerListDelims; /* delimiters between layer ranges */
127  char *layers; /* null delimited list of layer names */
128  char **layerIDs; /* array of layer names */
129  int numLayers; /* number of layers */
130  int *layerlist;
131 
132  /* default font */
135 
136  /* default line style */
138 
139  /* render defaults set from graph */
140  gvcolor_t bgcolor; /* background color */
141 
142  /* whether to mangle font names (at least in SVG), usually false */
144  };
145 
146 extern GVC_t* gvCloneGVC (GVC_t *);
147 extern void gvFreeCloneGVC (GVC_t *);
148 
149 #ifdef _WIN32
150 #define DIRSEP "\\"
151 #else
152 #define DIRSEP "/"
153 #endif
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 #endif /* GVCINT_H */
int * layerlist
Definition: gvcint.h:130
struct gvplugin_active_layout_s gvplugin_active_layout_t
char * layerListDelims
Definition: gvcint.h:126
int rotation
Definition: gvcint.h:121
gvplugin_package_t * next
Definition: gvcint.h:44
boolean graph_sets_pageSize
Definition: gvcint.h:122
Dt_t * textfont_dt
Definition: gvcint.h:96
pointf pad
Definition: gvcint.h:117
#define APIS
Definition: gvcext.h:28
gvplugin_available_t * next
Definition: gvcint.h:50
gvplugin_active_layout_t layout
Definition: gvcint.h:109
Definition: geom.h:28
void gvFreeCloneGVC(GVC_t *)
Definition: gvcontext.c:125
Definition: cdt.h:80
int fontrenaming
Definition: gvcint.h:143
char ** input_filenames
Definition: gvcint.h:77
const char * typestr
Definition: gvcint.h:51
graph_t * g
Definition: gvcint.h:106
Definition: color.h:34
gvplugin_available_t * api[APIS]
Definition: gvcint.h:87
GVC_t * gvc
Definition: gvcint.h:60
pointf pageSize
Definition: gvcint.h:118
char ** layerIDs
Definition: gvcint.h:128
Definition: gvcjob.h:271
GVC_t * gvCloneGVC(GVC_t *)
Definition: gvcontext.c:113
gvlayout_engine_t * engine
Definition: gvcint.h:29
Dtdisc_t textfont_disc
Definition: gvcint.h:95
gvplugin_active_textlayout_t textlayout
Definition: gvcint.h:97
gvlayout_features_t * features
Definition: gvcint.h:31
pointf margin
Definition: gvcint.h:116
boxf bb
Definition: gvcint.h:120
GVG_t * next
Definition: gvcint.h:61
const char * type
Definition: gvcint.h:32
char * defaultfontname
Definition: gvcint.h:133
gvcolor_t bgcolor
Definition: gvcint.h:140
GVG_t * gvg
Definition: gvcint.h:81
boolean graph_sets_rotation
Definition: gvcint.h:122
gvplugin_package_t * packages
Definition: gvcint.h:89
Definition: gvcint.h:70
double defaultfontsize
Definition: gvcint.h:134
graph_t * g
Definition: gvcint.h:65
boolean graph_sets_pad
Definition: gvcint.h:122
GVJ_t * active_jobs
Definition: gvcint.h:112
GVG_t * gvgs
Definition: gvcint.h:80
GVJ_t * jobs
Definition: gvcint.h:103
char * graphname
Definition: gvcint.h:111
Definition: gvcint.h:59
char * input_filename
Definition: gvcint.h:63
Definition: grammar.c:79
int graph_index
Definition: gvcint.h:64
gvtextlayout_engine_t * engine
Definition: gvcint.h:36
boolean graph_sets_margin
Definition: gvcint.h:122
point pb
Definition: gvcint.h:119
char * layers
Definition: gvcint.h:127
Definition: geom.h:26
char * layerDelims
Definition: gvcint.h:125
boolean config_found
Definition: gvcint.h:74
char * pagedir
Definition: gvcint.h:115
GVCOMMON_t common
Definition: gvcint.h:71
Definition: cdt.h:99
gvplugin_available_t * apis[APIS]
Definition: gvcint.h:86
char * config_path
Definition: gvcint.h:73
gvplugin_installed_t * typeptr
Definition: gvcint.h:55
GVJ_t * job
Definition: gvcint.h:104
char ** defaultlinestyle
Definition: gvcint.h:137
Definition: geom.h:35
int numLayers
Definition: gvcint.h:129
size_t(* write_fn)(GVJ_t *job, const char *s, size_t len)
Definition: gvcint.h:92
struct gvplugin_active_textlayout_s gvplugin_active_textlayout_t
gvplugin_package_t * package
Definition: gvcint.h:54