Commit 3d412039 authored by John Ellson's avatar John Ellson

move lasi plugin to graphviz-x

parent 61272639
......@@ -9,7 +9,7 @@
# * Contributors: See CVS logs. Details at http://www.graphviz.org/
# *************************************************************************/
BEGIN { s = ARGV[1]; gsub (".*/", "", s); gsub("\\.","_",s); printf("const char *%s[] = {\n",s); }
BEGIN { s = ARGV[1]; gsub (".*/", "", s); gsub("\\.","_",s); printf("static const char *%s[] = {\n",s); }
/^#/ { print $0; next; }
{ gsub("\\\\","&&",$0); printf("\"%s\",\n",$0); }
END { printf("(char*)0 };\n"); }
......@@ -124,6 +124,11 @@ dot_builtins_LDADD += $(top_builddir)/plugin/webp/libgvplugin_webp.la $(WEBP_LIB
endif
endif
if WITH_LASI
dot_static_LDADD += $(top_builddir)/plugin/lasi/.libs/libgvplugin_lasi_C.a $(LASI_LIBS) -lstdc++
dot_builtins_LDADD += $(top_builddir)/plugin/lasi/libgvplugin_lasi.la $(LASI_LIBS) -lstdc++
endif
EXTRA_DIST = Makefile.old dot.1 dot.1.pdf osage.1 osage.1.pdf patchwork.1 patchwork.1.pdf dot.vcproj
DISTCLEANFILES = dot.1.pdf osage.1.pdf
......@@ -32,6 +32,9 @@ extern gvplugin_library_t gvplugin_pango_LTX_library;
extern gvplugin_library_t gvplugin_webp_LTX_library;
#endif
#endif
#ifdef HAVE_LASI
extern gvplugin_library_t gvplugin_lasi_LTX_library;
#endif
extern gvplugin_library_t gvplugin_core_LTX_library;
......@@ -44,6 +47,9 @@ lt_symlist_t lt_preloaded_symbols[] = {
{ "gvplugin_webp_LTX_library", (void*)(&gvplugin_webp_LTX_library) },
#endif
#endif
#ifdef HAVE_LASI
{ "gvplugin_lasi_LTX_library", (void*)(&gvplugin_lasi_LTX_library) },
#endif
#ifdef HAVE_LIBGD
{ "gvplugin_gd_LTX_library", (void*)(&gvplugin_gd_LTX_library) },
#endif
......
......@@ -205,6 +205,9 @@ fi
%if 0%{?PANGOCAIRO}
%exclude %{_libdir}/graphviz/libgvplugin_pango.*
%endif
%if 0%{?LASI}
%exclude %{_libdir}/graphviz/libgvplugin_lasi.*
%endif
%if 0%{?GDK_PIXBUF}
%exclude %{_libdir}/graphviz/libgvplugin_gdk_pixbuf.*
%endif
......@@ -225,6 +228,7 @@ fi
%exclude %{_libdir}/graphviz/*fdb
%endif
%if 0%{?SMYRNA}
%exclude %{_bindir}/smyrna
%exclude %{_datadir}/graphviz/smyrna
%endif
......@@ -253,6 +257,9 @@ LD_LIBRARY_PATH=$RPM_INSTALL_PREFIX0/%{_lib} $RPM_INSTALL_PREFIX0/bin/dot -c
%if 0%{?PANGOCAIRO}
%{_libdir}/graphviz/libgvplugin_pango.*
%endif
%if 0%{?LASI}
%{_libdir}/graphviz/libgvplugin_lasi.*
%endif
%if 0%{?GDK_PIXBUF}
%{_libdir}/graphviz/libgvplugin_gdk_pixbuf.*
%endif
......@@ -263,6 +270,7 @@ LD_LIBRARY_PATH=$RPM_INSTALL_PREFIX0/%{_lib} $RPM_INSTALL_PREFIX0/bin/dot -c
%endif
%{_libdir}/graphviz/libgvplugin_xlib.*
%if 0%{?SMYRNA}
%{_bindir}/smyrna
%{_datadir}/graphviz/smyrna
%endif
......@@ -502,12 +510,17 @@ Perl extension for graphviz.
Group: Applications/Multimedia
Summary: PHP extension for graphviz
Requires: graphviz = %{version}-%{release} php
%if 0%{?fedora} >= 17
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
%else
%if 0%{?fedora} == 16
Requires: php-api = %{php_apiver}
%else
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
%endif
%endif
%description php
PHP extension for graphviz.
......
......@@ -297,9 +297,7 @@ gvplugin_installed_t gvloadimage_core_types[] = {
{FORMAT_JPEG_VRML, "jpg:vrml", 1, &engine_vrml, NULL},
{FORMAT_PS_PS, "eps:ps", 1, &engine_ps, NULL},
{FORMAT_PS_PS, "eps:lasi", 1, &engine_ps, NULL},
{FORMAT_PS_PS, "ps:ps", 1, &engine_ps, NULL},
{FORMAT_PS_PS, "ps:lasi", 1, &engine_ps, NULL},
{FORMAT_PSLIB_PS, "(lib):ps", 1, &engine_pslib, NULL}, /* for pslib */
{FORMAT_PNG_MAP, "png:map", 1, &engine_null, NULL},
......
......@@ -30,6 +30,7 @@ endif
libgvplugin_lasi_C_la_SOURCES = \
gvplugin_lasi.c \
gvrender_lasi.cpp \
gvloadimage_lasi.c \
ps.txt
libgvplugin_lasi_la_LDFLAGS = -version-info @GVPLUGIN_VERSION_INFO@
......
/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#if HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef _MSC_VER
#include <io.h>
#endif
#include "gvplugin_loadimage.h"
#include "agxbuf.h"
#include "utils.h"
#include "gvio.h"
extern shape_desc *find_user_shape(char *name);
typedef enum {
FORMAT_PS_PS,
} format_type;
static void ps_freeimage(usershape_t *us)
{
#if HAVE_SYS_MMAN_H
munmap(us->data, us->datasize);
#else
free(us->data);
#endif
}
/* usershape described by a postscript file */
static void lasi_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
{
assert(job);
assert(us);
assert(us->name);
if (us->data) {
if (us->datafree != ps_freeimage) {
us->datafree(us); /* free incompatible cache data */
us->data = NULL;
us->datafree = NULL;
us->datasize = 0;
}
}
if (!us->data) { /* read file into cache */
int fd;
struct stat statbuf;
if (!gvusershape_file_access(us))
return;
fd = fileno(us->f);
switch (us->type) {
case FT_PS:
case FT_EPS:
fstat(fd, &statbuf);
us->datasize = statbuf.st_size;
#if HAVE_SYS_MMAN_H
us->data = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
#else
us->data = malloc(statbuf.st_size);
read(fd, us->data, statbuf.st_size);
#endif
us->must_inline = TRUE;
break;
default:
break;
}
if (us->data)
us->datafree = ps_freeimage;
gvusershape_file_release(us);
}
if (us->data) {
gvprintf(job, "gsave %g %g translate newpath\n",
b.LL.x - (double)(us->x), b.LL.y - (double)(us->y));
if (us->must_inline)
epsf_emit_body(job, us);
else
gvprintf(job, "user_shape_%d\n", us->macro_id);
gvprintf(job, "grestore\n");
}
}
static gvloadimage_engine_t engine_ps = {
lasi_loadimage_ps
};
gvplugin_installed_t gvloadimage_lasi_types[] = {
{FORMAT_PS_PS, "eps:lasi", 1, &engine_ps, NULL},
{FORMAT_PS_PS, "ps:lasi", 1, &engine_ps, NULL},
{0, NULL, 0, NULL, NULL}
};
......@@ -15,10 +15,12 @@
extern gvplugin_installed_t gvdevice_lasi_types[];
extern gvplugin_installed_t gvrender_lasi_types[];
extern gvplugin_installed_t gvloadimage_lasi_types[];
static gvplugin_api_t apis[] = {
{API_device, gvdevice_lasi_types},
{API_render, gvrender_lasi_types},
{API_render, gvloadimage_lasi_types},
{(api_t)0, 0},
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment