fi
AM_CONDITIONAL(WITH_FONTCONFIG, [test "x$use_fontconfig" = "xYes"])
+dnl -----------------------------------
+dnl INCLUDES and LIBS for GDK
+
+AC_ARG_WITH(gdk,
+ [AS_HELP_STRING([--with-gdk=yes],[gdklibrary])],
+ [], [with_gdk=yes])
+
+if test "x$with_gdk" != "xyes"; then
+ use_gdk="No (disabled)"
+else
+ PKG_CHECK_MODULES(GDK, [gdk-2.0],[
+ use_gdk="Yes"
+ AC_DEFINE_UNQUOTED(HAVE_GDK,1,
+ [Define if you have the gdk library])
+ AC_SUBST([GDK_CFLAGS])
+ AC_SUBST([GDK_LIBS])
+ ],[
+ use_gdk_pixbuf="No (gdk library not available)"
+ ])
+fi
+AM_CONDITIONAL(WITH_GDK, [test "x$use_gdk" = "xYes"])
+
dnl -----------------------------------
dnl INCLUDES and LIBS for GDK_PIXBUF.
plugin/core/Makefile
plugin/devil/Makefile
plugin/gd/Makefile
- plugin/gdk_pixbuf/Makefile
+ plugin/gdk/Makefile
plugin/gdiplus/Makefile
plugin/glitz/Makefile
plugin/gs/Makefile
echo " devil: $use_devil"
echo " gd: $use_gd"
echo " gdiplus: $use_gdiplus"
+echo " gdk: $use_gdk"
echo " gdk_pixbuf: $use_gdk_pixbuf"
echo " ghostscript: $use_ghostscript"
echo " glitz: $use_glitz"
# Available features are:
# SHARP GHOSTSCRIPT GUILE _IO JAVA LUA OCAML ORTHO PERL PHP
# PYTHON RUBY R_LANG TCL IPSEPCOLA MYLIBGD PANGOCAIRO RSVG
-# GTK GLITZ SMYRNA DEVIL MING GDK_PIXBUF _QT WEBP
+# GTK GLITZ SMYRNA DEVIL MING GDK _QT WEBP
# SuSE uses a different mechanism to generate BuildRequires
# norootforbuild
BuildRequires: php-devel
%define MYLIBGD 0
BuildRequires: gd gd-devel
-%define GDK_PIXBUF 1
+%define GDK 1
%define GHOSTSCRIPT 1
BuildRequires: ghostscript-devel
%define POPPLER 1
BuildRequires: gts-devel
%define LASI 1
BuildRequires: lasi-devel
-%define GDK_PIXBUF 1
+%define GDK 1
%define IPSEPCOLA 1
%define ORTHO 1
%define GTK 1
%if 0%{?LASI}
%{_libdir}/graphviz/libgvplugin_lasi.so.*
%endif
-%if 0%{?GDK_PIXBUF}
-%{_libdir}/graphviz/libgvplugin_gdk_pixbuf.so.*
+%if 0%{?GDK}
+%{_libdir}/graphviz/libgvplugin_gdk.so.*
%endif
%if 0%{?GTK}
%{_libdir}/graphviz/libgvplugin_gtk.so.*
--enable-tcl%{!?TCL:=no} \
--with%{!?DEVIL:out}-devil \
--with%{!?WEBP:out}-webp \
- --with%{!?GDK_PIXBUF:out}-gdk-pixbuf \
+ --with%{!?GDK:out}-gdk \
--with%{!?GHOSTSCRIPT:out}-ghostscript \
--with%{!?GLITZ:out}-glitz \
--with%{!?IPSEPCOLA:out}-ipsepcola \
# $Id$ $Revision$
## Process this file with automake to produce Makefile.in
-SUBDIRS = core devil gd gdk_pixbuf gdiplus glitz gs gtk lasi ming pango quartz rsvg visio xlib dot_layout neato_layout webp poppler
+SUBDIRS = core devil gd gdk gdiplus glitz gs gtk lasi ming pango quartz rsvg visio xlib dot_layout neato_layout webp poppler
EXTRA_DIST = Makefile.old
--- /dev/null
+# $Id$ $Revision$
+## Process this file with automake to produce Makefile.in
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/lib/common \
+ -I$(top_srcdir)/lib/pathplan \
+ -I$(top_srcdir)/lib/gvc \
+ -I$(top_srcdir)/lib/cgraph \
+ -I$(top_srcdir)/lib/cdt \
+ $(PANGOCAIRO_CFLAGS) $(GDK_PIXBUF_CFLAGS) $(GDK_CFLAGS)
+
+if WITH_PANGOCAIRO
+if WITH_GDK
+if WITH_GDK_PIXBUF
+noinst_LTLIBRARIES = libgvplugin_gdk_C.la
+if WITH_WIN32
+lib_LTLIBRARIES = libgvplugin_gdk.la
+else
+pkglib_LTLIBRARIES = libgvplugin_gdk.la
+endif
+endif
+endif
+endif
+
+libgvplugin_gdk_C_la_SOURCES = \
+ gvplugin_gdk.c \
+ gvdevice_gdk.c \
+ gvloadimage_gdk.c
+
+libgvplugin_gdk_la_LDFLAGS = -version-info @GVPLUGIN_VERSION_INFO@
+libgvplugin_gdk_la_SOURCES = $(libgvplugin_gdk_C_la_SOURCES)
+libgvplugin_gdk_la_LIBADD = \
+ $(top_builddir)/lib/gvc/libgvc.la @GDK_PIXBUF_LIBS@ @PANGOCAIRO_LIBS@ @GDK_LIBS@
+
+if WITH_WIN32
+libgvplugin_gdk_la_LDFLAGS += -no-undefined
+endif
+
+if WITH_DARWIN9
+libgvplugin_gdk_la_LDFLAGS += -Wl,-exported_symbol,_gvplugin_gdk_LTX_library
+endif
+
+EXTRA_DIST = Makefile.old
+
-all: libgvplugin_gdk_pixbuf.a
+all: libgvplugin_gdk.a
ROOT=../..
include $(ROOT)/Config.mk
include $(ROOT)/makearch/$(ARCH)
DEFINES = -DHAVE_CONFIG_H
-OBJS = gvformatter_gdk_pixbuf.o gvplugin_gdk_pixbuf.o
+OBJS = gvformatter_gdk.o gvplugin_gdk.o
-libgvplugin_gdk_pixbuf.a : $(OBJS)
- $(RM) libgvplugin_gdk_pixbuf.a
- $(AR) cr libgvplugin_gdk_pixbuf.a $(OBJS)
- $(RANLIB) libgvplugin_gdk_pixbuf.a
+libgvplugin_gdk.a : $(OBJS)
+ $(RM) libgvplugin_gdk.a
+ $(AR) cr libgvplugin_gdk.a $(OBJS)
+ $(RANLIB) libgvplugin_gdk.a
-install: libgvplugin_gdk_pixbuf.a
+install: libgvplugin_gdk.a
$(MKPATH) $(LIBDIR)
- $(INSTALL) libgvplugin_gdk_pixbuf.a $(LIBDIR)
+ $(INSTALL) libgvplugin_gdk.a $(LIBDIR)
clean:
$(RM) core *.o
}
#endif
-static void gdk_pixbuf_freeimage(usershape_t *us)
+static void gdk_freeimage(usershape_t *us)
{
g_object_unref((GdkPixbuf*)(us->data));
}
-static GdkPixbuf* gdk_pixbuf_loadimage(GVJ_t * job, usershape_t *us)
+static GdkPixbuf* gdk_loadimage(GVJ_t * job, usershape_t *us)
{
GdkPixbuf *image = NULL;
assert(us->name);
if (us->data) {
- if (us->datafree == gdk_pixbuf_freeimage)
+ if (us->datafree == gdk_freeimage)
image = (GdkPixbuf*)(us->data); /* use cached data */
else {
us->datafree(us); /* free incompatible cache data */
}
if (image) {
us->data = (void*)image;
- us->datafree = gdk_pixbuf_freeimage;
+ us->datafree = gdk_freeimage;
}
gvusershape_file_release(us);
}
return image;
}
-static void gdk_pixbuf_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
+static void gdk_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
{
cairo_t *cr = (cairo_t *) job->context; /* target context */
GdkPixbuf *image;
- image = gdk_pixbuf_loadimage(job, us);
+ image = gdk_loadimage(job, us);
if (image) {
cairo_save(cr);
cairo_translate(cr,
}
}
-static gvloadimage_engine_t engine_gdk_pixbuf = {
- gdk_pixbuf_loadimage_cairo
+static gvloadimage_engine_t engine_gdk = {
+ gdk_loadimage_cairo
};
#endif
-gvplugin_installed_t gvloadimage_gdk_pixbuf_types[] = {
+gvplugin_installed_t gvloadimage_gdk_types[] = {
#ifdef HAVE_PANGOCAIRO
- {FORMAT_BMP_CAIRO, "bmp:cairo", 1, &engine_gdk_pixbuf, NULL},
- {FORMAT_JPEG_CAIRO, "jpe:cairo", 2, &engine_gdk_pixbuf, NULL},
- {FORMAT_JPEG_CAIRO, "jpg:cairo", 2, &engine_gdk_pixbuf, NULL},
- {FORMAT_JPEG_CAIRO, "jpeg:cairo", 2, &engine_gdk_pixbuf, NULL},
- {FORMAT_PNG_CAIRO, "png:cairo", -1, &engine_gdk_pixbuf, NULL},
-// {FORMAT_ICO_CAIRO, "ico:cairo", -99, &engine_gdk_pixbuf, NULL},
-// {FORMAT_TIFF_CAIRO, "tif:cairo", -99, &engine_gdk_pixbuf, NULL},
-// {FORMAT_TIFF_CAIRO, "tiff`:cairo", -99, &engine_gdk_pixbuf, NULL},
+ {FORMAT_BMP_CAIRO, "bmp:cairo", 1, &engine_gdk, NULL},
+ {FORMAT_JPEG_CAIRO, "jpe:cairo", 2, &engine_gdk, NULL},
+ {FORMAT_JPEG_CAIRO, "jpg:cairo", 2, &engine_gdk, NULL},
+ {FORMAT_JPEG_CAIRO, "jpeg:cairo", 2, &engine_gdk, NULL},
+ {FORMAT_PNG_CAIRO, "png:cairo", -1, &engine_gdk, NULL},
+// {FORMAT_ICO_CAIRO, "ico:cairo", -99, &engine_gdk, NULL},
+// {FORMAT_TIFF_CAIRO, "tif:cairo", -99, &engine_gdk, NULL},
+// {FORMAT_TIFF_CAIRO, "tiff`:cairo", -99, &engine_gdk, NULL},
#endif
{0, NULL, 0, NULL, NULL}
};
+++ /dev/null
-# $Id$ $Revision$
-## Process this file with automake to produce Makefile.in
-
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/lib/common \
- -I$(top_srcdir)/lib/pathplan \
- -I$(top_srcdir)/lib/gvc \
- -I$(top_srcdir)/lib/cgraph \
- -I$(top_srcdir)/lib/cdt \
- $(PANGOCAIRO_CFLAGS) $(GDK_PIXBUF_CFLAGS) $(GTK_CFLAGS)
-
-if WITH_PANGOCAIRO
-if WITH_GDK_PIXBUF
-noinst_LTLIBRARIES = libgvplugin_gdk_pixbuf_C.la
-if WITH_WIN32
-lib_LTLIBRARIES = libgvplugin_gdk_pixbuf.la
-else
-pkglib_LTLIBRARIES = libgvplugin_gdk_pixbuf.la
-endif
-endif
-endif
-
-libgvplugin_gdk_pixbuf_C_la_SOURCES = \
- gvplugin_gdk_pixbuf.c \
- gvdevice_gdk_pixbuf.c \
- gvloadimage_gdk_pixbuf.c
-
-libgvplugin_gdk_pixbuf_la_LDFLAGS = -version-info @GVPLUGIN_VERSION_INFO@
-libgvplugin_gdk_pixbuf_la_SOURCES = $(libgvplugin_gdk_pixbuf_C_la_SOURCES)
-libgvplugin_gdk_pixbuf_la_LIBADD = \
- $(top_builddir)/lib/gvc/libgvc.la @GDK_PIXBUF_LIBS@
-
-if WITH_WIN32
-libgvplugin_gdk_pixbuf_la_LDFLAGS += -no-undefined
-endif
-
-if WITH_DARWIN9
-libgvplugin_gdk_pixbuf_la_LDFLAGS += -Wl,-exported_symbol,_gvplugin_gdk_pixbuf_LTX_library
-endif
-
-EXTRA_DIST = Makefile.old
-
+++ /dev/null
-/* $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 "gvplugin_device.h"
-#include "gvio.h"
-#ifdef HAVE_PANGOCAIRO
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-typedef enum {
- FORMAT_BMP,
- FORMAT_ICO,
- FORMAT_JPEG,
- FORMAT_PNG,
- FORMAT_TIFF,
- } format_type;
-
-/*
- * Does an in-place conversion of a CAIRO ARGB32 image to GDK RGBA
- */
-static void
-argb2rgba ( unsigned int width, unsigned int height, char *data)
-{
-/* define indexes to color bytes in each format */
-#define Ba 0
-#define Ga 1
-#define Ra 2
-#define Aa 3
-
-#define Rb 0
-#define Gb 1
-#define Bb 2
-#define Ab 3
-
- unsigned int x, y;
-
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
- /* swap red and blue */
- unsigned char r = data[Ra];
- data[Bb] = data[Ba];
- data[Rb] = r;
- data += 4;
- }
- }
-}
-
-static gboolean
-writer ( const gchar *buf, gsize count, GError **error, gpointer data)
-{
- if (count == gvwrite((GVJ_t *)data, buf, count))
- return TRUE;
- return FALSE;
-}
-
-static void gdk_pixbuf_format(GVJ_t * job)
-{
- char *format_str = "";
- GdkPixbuf *pixbuf;
-
- switch (job->device.id) {
- case FORMAT_BMP:
- format_str = "bmp";
- break;
- case FORMAT_ICO:
- format_str = "ico";
- break;
- case FORMAT_JPEG:
- format_str = "jpeg";
- break;
- case FORMAT_PNG:
- format_str = "png";
- break;
- case FORMAT_TIFF:
- format_str = "tiff";
- break;
- }
-
- argb2rgba(job->width, job->height, job->imagedata);
-
- pixbuf = gdk_pixbuf_new_from_data(
- (unsigned char*)(job->imagedata), // data
- GDK_COLORSPACE_RGB, // colorspace
- TRUE, // has_alpha
- 8, // bits_per_sample
- job->width, // width
- job->height, // height
- 4 * job->width, // rowstride
- NULL, // destroy_fn
- NULL // destroy_fn_data
- );
-
- gdk_pixbuf_save_to_callback(pixbuf, writer, job, format_str, NULL, NULL);
-
- gdk_pixbuf_unref(pixbuf);
-}
-
-static gvdevice_engine_t gdk_pixbuf_engine = {
- NULL, /* gdk_pixbuf_initialize */
- gdk_pixbuf_format,
- NULL, /* gdk_pixbuf_finalize */
-};
-
-static gvdevice_features_t device_features_gdk_pixbuf = {
- GVDEVICE_BINARY_FORMAT
- | GVDEVICE_DOES_TRUECOLOR,/* flags */
- {0.,0.}, /* default margin - points */
- {0.,0.}, /* default page width, height - points */
- {96.,96.}, /* dpi */
-};
-#endif
-
-gvplugin_installed_t gvdevice_gdk_pixbuf_types[] = {
-#ifdef HAVE_PANGOCAIRO
- {FORMAT_BMP, "bmp:cairo", 4, &gdk_pixbuf_engine, &device_features_gdk_pixbuf},
- {FORMAT_ICO, "ico:cairo", 4, &gdk_pixbuf_engine, &device_features_gdk_pixbuf},
- {FORMAT_JPEG, "jpe:cairo", 4, &gdk_pixbuf_engine, &device_features_gdk_pixbuf},
- {FORMAT_JPEG, "jpeg:cairo", 4, &gdk_pixbuf_engine, &device_features_gdk_pixbuf},
- {FORMAT_JPEG, "jpg:cairo", 4, &gdk_pixbuf_engine, &device_features_gdk_pixbuf},
- {FORMAT_PNG, "png:cairo", 4, &gdk_pixbuf_engine, &device_features_gdk_pixbuf},
- {FORMAT_TIFF, "tif:cairo", 4, &gdk_pixbuf_engine, &device_features_gdk_pixbuf},
- {FORMAT_TIFF, "tiff:cairo", 4, &gdk_pixbuf_engine, &device_features_gdk_pixbuf},
-#endif
- {0, NULL, 0, NULL, NULL}
-};
+++ /dev/null
-/* $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/
- *************************************************************************/
-
-#include "gvplugin.h"
-
-extern gvplugin_installed_t gvdevice_gdk_pixbuf_types[];
-extern gvplugin_installed_t gvloadimage_gdk_pixbuf_types[];
-
-static gvplugin_api_t apis[] = {
- {API_device, gvdevice_gdk_pixbuf_types},
- {API_loadimage, gvloadimage_gdk_pixbuf_types},
- {(api_t)0, 0},
-};
-
-gvplugin_library_t gvplugin_gdk_pixbuf_LTX_library = { "gdk_pixbuf", apis };