libgv_sharp_la_CPPFLAGS = $(BASECPPFLAGS) $(SHARP_INCLUDES)
$(SHARP_data): gv_sharp.cpp
gv_sharp.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -csharp -namespace gv -o gv_sharp.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -csharp -namespace gv -o gv_sharp.cpp $(srcdir)/gv.i
pkggodir = $(pkglibdir)/go
GO_data =
libgv_go_la_CPPFLAGS = $(BASECPPFLAGS) $(GO_INCLUDES)
# $(GO_data): gv_go.cpp
gv_go.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -go -o gv_go.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -go -o gv_go.cpp $(srcdir)/gv.i
pkgguiledir = $(pkglibdir)/guile
GUILE_data =
libgv_guile_la_CPPFLAGS = $(BASECPPFLAGS) $(GUILE_INCLUDES)
# $(GUILE_data): gv_guile.cpp
gv_guile.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -guile -o gv_guile.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -guile -o gv_guile.cpp $(srcdir)/gv.i
$(SED) -e 's/SWIG_GUILE_INIT_STATIC void/void/' <gv_guile.cpp >t$$
mv -f t$$ gv_guile.cpp
libgv_io_la_CPPFLAGS = $(BASECPPFLAGS) $(IO_INCLUDES)
# $(IO_data): gv_io.cpp
gv_io.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -io -o gv_io.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -io -o gv_io.cpp $(srcdir)/gv.i
pkgjavadir = $(pkglibdir)/java
JAVA_data = gv.java gvJNI.java SWIGTYPE_p_Agraph_t.java SWIGTYPE_p_Agnode_t.java SWIGTYPE_p_Agedge_t.java SWIGTYPE_p_Agsym_t.java SWIGTYPE_p_FILE.java
libgv_java_la_CPPFLAGS = $(BASECPPFLAGS) $(JAVA_INCLUDES)
$(JAVA_data): gv_java.cpp
gv_java.cpp: gv.i
- $(SWIG) $(DEFS) -package org.graphviz -c++ -java -o gv_java.cpp $(srcdir)/gv.i
+ $(SWIG) -package org.graphviz -c++ -java -o gv_java.cpp $(srcdir)/gv.i
pkgluadir = $(pkglibdir)/lua
LUA_data =
libgv_lua_la_CPPFLAGS = $(BASECPPFLAGS) $(LUA_INCLUDES)
# $(LUA_data): gv_lua.cpp
gv_lua.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -lua -o gv_lua.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -lua -o gv_lua.cpp $(srcdir)/gv.i
mv $@ $@.orig
sed '/include/s/malloc\.h/cstdlib/' $@.orig > $@
libgv_ocaml_la_CPPFLAGS = $(BASECPPFLAGS) $(OCAML_INCLUDES)
gv.ml gv.mli: gv_ocaml.cpp
gv_ocaml.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -ocaml -o gv_ocaml.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -ocaml -o gv_ocaml.cpp $(srcdir)/gv.i
swig.mli:
$(SWIG) -ocaml -co swig.mli
swig.ml:
libgv_perl_la_CPPFLAGS = $(BASECPPFLAGS) $(PERL_CC)
$(PERL_data): gv_perl.cpp
gv_perl.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -perl -o gv_perl.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -perl -o gv_perl.cpp $(srcdir)/gv.i
pkgphpdir = $(pkglibdir)/php
PHP_data = gv.php
gv.php: gv_php.cpp
php_gv.h: gv_php.cpp
gv_php.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -php5 -o gv_php.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -php5 -o gv_php.cpp $(srcdir)/gv.i
pkgpythondir = $(pkglibdir)/python
PYTHON_data = gv.py
libgv_python_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON_INCLUDES)
$(PYTHON_data): gv_python.cpp
gv_python.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -python -o gv_python.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -python -o gv_python.cpp $(srcdir)/gv.i
pkgpython23dir = $(pkglibdir)/python23
PYTHON23_data = gv.py
libgv_python23_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON23_INCLUDES)
# $(PYTHON23_data): gv_python23.cpp
gv_python23.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -python -classic -o gv_python23.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -python -classic -o gv_python23.cpp $(srcdir)/gv.i
pkgpython24dir = $(pkglibdir)/python24
PYTHON24_data = gv.py
libgv_python24_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON24_INCLUDES)
# $(PYTHON24_data): gv_python24.cpp
gv_python24.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -python -classic -o gv_python24.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -python -classic -o gv_python24.cpp $(srcdir)/gv.i
pkgpython25dir = $(pkglibdir)/python25
PYTHON25_data = gv.py
libgv_python25_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON25_INCLUDES)
# $(PYTHON25_data): gv_python25.cpp
gv_python25.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -python -classic -o gv_python25.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -python -classic -o gv_python25.cpp $(srcdir)/gv.i
pkgpython26dir = $(pkglibdir)/python26
PYTHON26_data = gv.py
libgv_python26_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON26_INCLUDES)
# $(PYTHON26_data): gv_python26.cpp
gv_python26.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -python -o gv_python26.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -python -o gv_python26.cpp $(srcdir)/gv.i
pkgpython27dir = $(pkglibdir)/python27
PYTHON27_data = gv.py
libgv_python27_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON27_INCLUDES)
# $(PYTHON27_data): gv_python27.cpp
gv_python27.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -python -o gv_python27.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -python -o gv_python27.cpp $(srcdir)/gv.i
pkgRdir = $(pkglibdir)/R
R_data =
libgv_R_la_CPPFLAGS = $(BASECPPFLAGS) $(R_CFLAGS)
# $(R_data): gv_R.cpp
gv_R.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -r -o gv_R.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -r -o gv_R.cpp $(srcdir)/gv.i
pkgrubydir = $(pkglibdir)/ruby
RUBY_data =
libgv_ruby_la_CPPFLAGS = $(BASECPPFLAGS) $(RUBY_CFLAGS)
# $(RUBY_data): gv_ruby.cpp
gv_ruby.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -ruby -o gv_ruby.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -ruby -o gv_ruby.cpp $(srcdir)/gv.i
pkgtcldir = $(pkglibdir)/tcl
TCL_data =
libgv_tcl_la_CPPFLAGS = $(BASECPPFLAGS) $(TCL_INCLUDES)
# $(TCL_data): gv_tcl.cpp
gv_tcl.cpp: gv.i
- $(SWIG) $(DEFS) -c++ -tcl -namespace -o gv_tcl.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ -tcl -namespace -o gv_tcl.cpp $(srcdir)/gv.i
pkginclude_HEADERS = gv.i gv.cpp
pkglib_LTLIBRARIES =
Agnode_t *node(Agraph_t *g, char *name)
{
- // creating a protonode is not permitted
- if (!gvc || (name[0] == '\001' && strcmp (name, "\001proto") == 0))
+ if (!gvc)
return NULL;
#ifdef WITH_CGRAPH
return agnode(g, name, 1);
#else
+ // creating a protonode is not permitted
+ if (name[0] == '\001' && strcmp (name, "\001proto") == 0)
+ return NULL;
return agnode(g, name);
#endif
}
Agedge_t *edge(Agnode_t *t, Agnode_t *h)
{
- // edges from/to the protonode are not permitted
- if (!gvc || !t || !h
- || (agnameof(t)[0] == '\001' && strcmp (agnameof(t), "\001proto") == 0)
- || (agnameof(h)[0] == '\001' && strcmp (agnameof(h), "\001proto") == 0))
+ if (!gvc || !t || !h)
return NULL;
#ifdef WITH_CGRAPH
+ // edges from/to the protonode are not permitted
+ if ((AGTYPE(t) == AGRAPH) || (AGTYPE(h) == AGRAPH))
+ return NULL;
return agedge(agraphof(t), t, h, NULL, 1);
#else
+ // edges from/to the protonode are not permitted
+ if ( (agnameof(t)[0] == '\001' && strcmp (agnameof(t), "\001proto") == 0)
+ || (agnameof(h)[0] == '\001' && strcmp (agnameof(h), "\001proto") == 0))
+ return NULL;
return agedge(t->graph, t, h);
#endif
}
{
if (!n || !a || !val)
return NULL;
+#ifdef WITH_CGRAPH
+ if ( AGTYPE(n) == AGRAPH ) {
+// agattr(sg,AGNODE,"shape","box")
+ // FIXME - protonode
+ }
+#endif
myagxset(n, a, val);
return val;
}
return NULL;
g = agroot(agraphof(n));
#ifdef WITH_CGRAPH
+ if ( AGTYPE(n) == AGRAPH ) {
+// agattr(sg,AGNODE,"shape","box")
+ // FIXME - protonode
+ }
a = agattr(g, AGNODE, attr, NULL);
#else
a = agfindattr(g->proto->n, attr);
{
if (!e || !a || !val)
return NULL;
+#ifdef WITH_CGRAPH
+ if ( AGTYPE(e) == AGRAPH ) {
+ // FIXME - protonode
+ }
+#endif
myagxset(e, a, val);
return val;
}
return NULL;
g = agroot(agraphof(agtail(e)));
#ifndef WITH_CGRAPH
+ if ( AGTYPE(e) == AGRAPH ) {
+ // FIXME - protonode
+ }
a = agfindattr(g->proto->e, attr);
if (!a)
a = agedgeattr(g, attr, emptystring);
}
Agedge_t *protoedge(Agraph_t *g)
-{
+
if (!g)
return NULL;
return g->proto->e;
}
+#else
+/*
+ * CGRAPH's default attribute values are not in a node struct.
+ * so fake one
+ */
+static Agnode_t stub_protonode; //specifically .tag == AGRAPH
+
+Agnode_t *protonode(Agraph_t *g)
+{
+ if (!g)
+ return NULL;
+ return &stub_protonode;
+}
+
+static Agedge_t stub_protoedge; //specifically .tag == AGRAPH
+
+Agedge_t *protoedge(Agraph_t *g)
+{
+ if (!g)
+ return NULL;
+ return &stub_protoedge;
+}
#endif
//-------------------------------------------------
{
if (!n)
return false;
+#ifndef WITH_CGRAPH
// removal of the protonode is not permitted
if (agnameof(n)[0] == '\001' && strcmp (agnameof(n), "\001proto") ==0)
return false;
+#else
+ // removal of the protonode is not permitted
+ if (AGTYPE(n) == AGRAPH)
+ return false;
+#endif
agdelete(agraphof(n), n);
return true;
}
{
if (!e)
return false;
+#ifndef WITH_CGRAPH
// removal of the protoedge is not permitted
if ((agnameof(aghead(e))[0] == '\001' && strcmp (agnameof(aghead(e)), "\001proto") == 0)
|| (agnameof(agtail(e))[0] == '\001' && strcmp (agnameof(agtail(e)), "\001proto") == 0))
return false;
+#else
+ // removal of the protoedge is not permitted
+ if (AGTYPE(e) == AGRAPH)
+ return false;
+#endif
agdelete(agroot(agraphof(aghead(e))), e);
return true;
}