[dia/cairo-port] Make cairo a hard dep (It's already pulled in by Pango anyway)
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia/cairo-port] Make cairo a hard dep (It's already pulled in by Pango anyway)
- Date: Thu, 6 Dec 2018 15:00:22 +0000 (UTC)
commit a6f8663a42d9934a8468bc0a9f58deb863537894
Author: Zander Brown <zbrown gnome org>
Date: Thu Dec 6 14:58:47 2018 +0000
Make cairo a hard dep (It's already pulled in by Pango anyway)
app/app_procs.c | 10 -------
app/makefile.msc | 2 +-
app/toolbox.c | 2 --
configure.ac | 24 ++--------------
lib/Doxyfile | 2 --
lib/makefile.msc | 1 -
objects/makefile.msc | 3 +-
objects/standard/outline.c | 11 --------
objects/standard/standard.c | 2 --
plug-ins/cairo/Makefile.am | 4 ---
plug-ins/cairo/diacairo-renderer.c | 56 +-------------------------------------
plug-ins/cairo/diacairo.c | 20 +-------------
plug-ins/makefile.msc | 4 +--
13 files changed, 9 insertions(+), 132 deletions(-)
---
diff --git a/app/app_procs.c b/app/app_procs.c
index dfd84e9c..82290b93 100644
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -369,15 +369,11 @@ dump_dependencies(void)
#ifdef G_THREADS_ENABLED
"threads "
#endif
-#ifdef HAVE_CAIRO
"cairo "
-#endif
#ifdef HAVE_LIBART
"libart "
#endif
-#ifdef HAVE_PANGOCAIRO
"pangocairo "
-#endif
"\n");
/* print out all those dependies, both compile and runtime if possible
@@ -437,13 +433,7 @@ dump_dependencies(void)
#else
g_print ("pango : version not available (>= 1.14.x)\n"); /* Pango did not provide such */
#endif
-#if HAVE_CAIRO
-# ifdef CAIRO_VERSION_STRING
g_print ("cairo : %s (%s)\n", cairo_version_string(), CAIRO_VERSION_STRING);
-# else
- g_print ("cairo : %s (%d.%d.%d)\n", cairo_version_string(), CAIRO_VERSION_MAJOR, CAIRO_VERSION_MINOR,
CAIRO_VERSION_MICRO);
-# endif
-#endif
#if 0
{
gchar linkedname[1024];
diff --git a/app/makefile.msc b/app/makefile.msc
index 50d5c0db..496cd029 100644
--- a/app/makefile.msc
+++ b/app/makefile.msc
@@ -15,7 +15,7 @@ DEFINES = \
-DWIN32 \
-DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED \
-PKG_LINK = $(GTK2_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) $(PANGOWIN32_LIBS) $(PANGOCAIRO_LIBS) \
+PKG_LINK = $(GTK2_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) $(PANGOWIN32_LIBS) \
$(LIBXML2_LIBS) \
$(PRJ_TOP)\lib\libdia.lib $(CAIRO_LIBS) \
$(GDK_PIXBUF_LIBS) $(INTL_LIBS) \
diff --git a/app/toolbox.c b/app/toolbox.c
index 8fdb424e..25e21e90 100644
--- a/app/toolbox.c
+++ b/app/toolbox.c
@@ -159,14 +159,12 @@ ToolButton tool_data[] =
"I",
"ToolsImage",
{ CREATE_OBJECT_TOOL, "Standard - Image", NULL }
-#ifdef HAVE_CAIRO
},
{ NULL,
N_("Outline"),
NULL,
"ToolsOutline",
{ CREATE_OBJECT_TOOL, "Standard - Outline", NULL }
-#endif
}
};
diff --git a/configure.ac b/configure.ac
index c99fc3f2..6cf912e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,8 +73,6 @@ AC_SUBST(GMODULE_LIBS)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
GTK_MODULES="gtk+-2.0 >= 2.16.0 glib-2.0 >= 2.20.0 libxml-2.0 gdk-pixbuf-2.0 gthread-2.0 gmodule-2.0"
-PKG_CHECK_MODULES(PANGOVERSION, pango >= 1.20.0 pangocairo, ,
- AC_MSG_ERROR([Need Pango version 1.20.0 or higher]))
AC_ARG_WITH(freetype,
AC_HELP_STRING([--without-freetype],[compile without FreeType support]),,with_freetype=yes)
@@ -136,24 +134,9 @@ fi
AM_CONDITIONAL(HAVE_BONOBO,[test "true" = "false"])
-dnl Look for Cairo
-AC_ARG_WITH(cairo,
- AC_HELP_STRING([--with-cairo],[compile cairo plug-in]),,with_cairo=yes)
-if test "x$with_cairo" != "xno"; then
- PKG_CHECK_MODULES(CAIROVERSION, cairo >= 1.6.0, ,
- AC_MSG_ERROR([Need Cairo version 1.6.0 or higher]))
- PKG_CHECK_MODULES(CAIRO, cairo,have_cairo=yes,have_cairo=no)
- AC_SUBST(CAIRO_LIBS)
- AC_SUBST(CAIRO_CFLAGS)
- AC_DEFINE(HAVE_CAIRO,1,[Define if building with Cairo support])
-fi
-AM_CONDITIONAL(WITH_CAIRO, test "x$with_cairo" != "xno")
-
-dnl with gtk+ >= 2.8 this is no longer optional
-PKG_CHECK_MODULES(PANGOCAIRO,pangocairo, pangocairo_ok=yes, pangocairo_ok=no)
-if test "x$pangocairo_ok" = "xyes"; then
- AC_DEFINE(HAVE_PANGOCAIRO_H,1,[Defined to render text with pangocairo not cairos toy API])
-fi
+PKG_CHECK_MODULES(CAIROVERSION, cairo >= 1.8.0)
+AC_SUBST(CAIRO_LIBS)
+AC_SUBST(CAIRO_CFLAGS)
dnl XSLT
@@ -731,7 +714,6 @@ Configuration:
Python support: ${with_python}
Libart support (PNG export): ${have_libart}
- Cairo support (PNG, PDF, print): ${with_cairo}
Dia Python bindings with SWIG ${with_swig}
PDF import with poppler (experimental) ${have_poppler}
WMF plug-in with libEMF: ${emf_ok}
diff --git a/lib/Doxyfile b/lib/Doxyfile
index 961b5ad1..859afa32 100644
--- a/lib/Doxyfile
+++ b/lib/Doxyfile
@@ -16,8 +16,6 @@ INPUT = ../lib ../objects/standard ../objects/custom \
../plug-ins/wpg ../plug-ins/drs
#STRIP_FROM_PATH = ../
FILE_PATTERNS = *.c *.h *.dox *.py *.cpp
-# define HAVE_CAIRO to get the Outline dox
-PREDEFINED = HAVE_CAIRO
REFERENCES_RELATION = NO
VERBATIM_HEADERS = NO
GENERATE_LATEX = NO
diff --git a/lib/makefile.msc b/lib/makefile.msc
index 01ba2aba..2c6d20c1 100644
--- a/lib/makefile.msc
+++ b/lib/makefile.msc
@@ -21,7 +21,6 @@ DEFINES = \
# in GTK_CFLAGS: $(GLIB_CFLAGS)
PKG_LINK = $(GTK2_LIBS) $(PANGOWIN32_LIBS) $(GLIB_LIBS) \
- $(PANGOCAIRO_LIBS) \
!IFDEF USEFT2
$(PANGOFT2_LIBS) \
!ENDIF
diff --git a/objects/makefile.msc b/objects/makefile.msc
index 286d8466..a814188f 100644
--- a/objects/makefile.msc
+++ b/objects/makefile.msc
@@ -47,8 +47,7 @@ DEFINES = \
-DGTK_DISABLE_DEPRECATED \
PKG_LINK = $(GLIB_LIBS) $(INTL_LIBS) \
- $(PRJ_TOP)\lib\libdia.lib \
- $(CAIRO_LIBS)
+ $(PRJ_TOP)\lib\libdia.lib
#
# Object definitions for the various plugins
diff --git a/objects/standard/outline.c b/objects/standard/outline.c
index 1cb5541a..deaaebac 100644
--- a/objects/standard/outline.c
+++ b/objects/standard/outline.c
@@ -37,12 +37,8 @@
#include "tool-icons.h"
-#ifdef HAVE_CAIRO
#include <cairo.h>
-
-#ifdef CAIRO_HAS_SVG_SURFACE
#include <cairo-svg.h>
-#endif
#define NUM_HANDLES 2
@@ -277,12 +273,7 @@ outline_update_data (Outline *outline)
cairo_path_destroy (outline->path);
outline->path = NULL;
/* surface will not be used to render anything, it is just to create the cairo context */
-#ifdef CAIRO_HAS_SVG_SURFACE
surface = cairo_svg_surface_create_for_stream (write_nul, NULL, 100, 100);
-#else
- /* if only I could remember why I have choosen the svg surface in the first place */
- surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 100, 100);
-#endif
cr = cairo_create (surface);
cairo_surface_destroy (surface); /* in fact: unref() */
style = dia_font_get_style (outline->font);
@@ -554,5 +545,3 @@ outline_select (Outline *outline, Point *clicked_point,
{
outline_update_handles (outline);
}
-
-#endif /* HAVE_CAIRO */
diff --git a/objects/standard/standard.c b/objects/standard/standard.c
index ea75b974..f21dfea8 100644
--- a/objects/standard/standard.c
+++ b/objects/standard/standard.c
@@ -68,9 +68,7 @@ dia_plugin_init(PluginInfo *info)
object_register_type(_bezierline_type);
object_register_type(_textobj_type);
object_register_type(_image_type);
-#ifdef HAVE_CAIRO
object_register_type(_outline_type);
-#endif
object_register_type(_polygon_type);
object_register_type(_beziergon_type);
diff --git a/plug-ins/cairo/Makefile.am b/plug-ins/cairo/Makefile.am
index cffc0eee..4e8bacba 100644
--- a/plug-ins/cairo/Makefile.am
+++ b/plug-ins/cairo/Makefile.am
@@ -1,4 +1,3 @@
-if WITH_CAIRO
plugin_sources = \
diacairo.c \
diacairo.h \
@@ -6,9 +5,6 @@ plugin_sources = \
diacairo-renderer.c \
diacairo-print.c \
diacairo-print.h
-else
-plugin_sources =
-endif
pkglib_LTLIBRARIES = libcairo_filter.la
diff --git a/plug-ins/cairo/diacairo-renderer.c b/plug-ins/cairo/diacairo-renderer.c
index ea22235e..1c5c0144 100644
--- a/plug-ins/cairo/diacairo-renderer.c
+++ b/plug-ins/cairo/diacairo-renderer.c
@@ -30,24 +30,18 @@
#include <glib.h>
#include <glib/gstdio.h>
-#ifdef HAVE_PANGOCAIRO_H
#include <pango/pangocairo.h>
-#endif
#include <cairo.h>
/* some backend headers, win32 missing in official Cairo */
-#ifdef CAIRO_HAS_PNG_SURFACE_FEATURE
#include <cairo-png.h>
-#endif
+#include <cairo-svg.h>
#ifdef CAIRO_HAS_PS_SURFACE
#include <cairo-ps.h>
#endif
#ifdef CAIRO_HAS_PDF_SURFACE
#include <cairo-pdf.h>
#endif
-#ifdef CAIRO_HAS_SVG_SURFACE
-#include <cairo-svg.h>
-#endif
#include "intl.h"
#include "message.h"
@@ -149,10 +143,8 @@ begin_render(DiaRenderer *self, const Rectangle *update)
background.blue,
1.0);
}
-#ifdef HAVE_PANGOCAIRO_H
if (!renderer->layout)
renderer->layout = pango_cairo_create_layout (renderer->cr);
-#endif
cairo_set_fill_rule (renderer->cr, CAIRO_FILL_RULE_EVEN_ODD);
@@ -520,26 +512,10 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
PangoFontDescription *pfd = pango_font_description_copy (dia_font_get_description (font));
DIAG_NOTE(g_message("set_font %f %s", height, dia_font_get_family(font)));
-#ifdef HAVE_PANGOCAIRO_H
/* select font and size */
pango_font_description_set_absolute_size (pfd, (int)(size * FONT_SIZE_TWEAK * PANGO_SCALE));
pango_layout_set_font_description (renderer->layout, pfd);
pango_font_description_free (pfd);
-#else
- if (renderer->cr) {
- DiaFontStyle style = dia_font_get_style (font);
- const char *family_name = dia_font_get_family(font);
-
- cairo_select_font_face (
- renderer->cr,
- family_name,
- DIA_FONT_STYLE_GET_SLANT(style) == DIA_FONT_NORMAL ? CAIRO_FONT_SLANT_NORMAL :
CAIRO_FONT_SLANT_ITALIC,
- DIA_FONT_STYLE_GET_WEIGHT(style) < DIA_FONT_MEDIUM ? CAIRO_FONT_WEIGHT_NORMAL :
CAIRO_FONT_WEIGHT_BOLD);
- cairo_set_font_size (renderer->cr, size);
-
- DIAG_STATE(renderer->cr)
- }
-#endif
/* for the interactive case we must maintain the font field in the base class */
if (self->is_interactive) {
@@ -893,7 +869,6 @@ draw_string(DiaRenderer *self,
if (len < 1) return; /* shouldn't this be handled by Dia's core ? */
cairo_set_source_rgba (renderer->cr, color->red, color->green, color->blue, color->alpha);
-#ifdef HAVE_PANGOCAIRO_H
cairo_save (renderer->cr);
/* alignment calculation done by pangocairo? */
pango_layout_set_alignment (renderer->layout, alignment == ALIGN_CENTER ? PANGO_ALIGN_CENTER :
@@ -920,33 +895,6 @@ draw_string(DiaRenderer *self,
pango_cairo_show_layout (renderer->cr, renderer->layout);
/* restoring the previous scale */
cairo_restore (renderer->cr);
-#else
- /* using the 'toy API' */
- {
- cairo_text_extents_t extents;
- double x = 0, y = 0;
- cairo_set_source_rgba (renderer->cr, color->red, color->green, color->blue, color->alpha);
- cairo_text_extents (renderer->cr,
- text,
- &extents);
-
- y = pos->y; /* ?? */
-
- switch (alignment) {
- case ALIGN_LEFT:
- x = pos->x;
- break;
- case ALIGN_CENTER:
- x = pos->x - extents.width / 2 + +extents.x_bearing;
- break;
- case ALIGN_RIGHT:
- x = pos->x - extents.width + extents.x_bearing;
- break;
- }
- cairo_move_to (renderer->cr, x, y);
- cairo_show_text (renderer->cr, text);
- }
-#endif
DIAG_STATE(renderer->cr)
}
@@ -1239,10 +1187,8 @@ cairo_renderer_finalize (GObject *object)
cairo_destroy (renderer->cr);
if (renderer->surface)
cairo_surface_destroy (renderer->surface);
-#ifdef HAVE_PANGOCAIRO_H
if (renderer->layout)
g_object_unref (renderer->layout);
-#endif
G_OBJECT_CLASS (parent_class)->finalize (object);
}
diff --git a/plug-ins/cairo/diacairo.c b/plug-ins/cairo/diacairo.c
index c06eecf7..e0842d02 100644
--- a/plug-ins/cairo/diacairo.c
+++ b/plug-ins/cairo/diacairo.c
@@ -32,18 +32,14 @@
#include <cairo.h>
/* some backend headers, win32 missing in official Cairo */
-#ifdef CAIRO_HAS_PNG_SURFACE_FEATURE
#include <cairo-png.h>
-#endif
+#include <cairo-svg.h>
#ifdef CAIRO_HAS_PS_SURFACE
#include <cairo-ps.h>
#endif
#ifdef CAIRO_HAS_PDF_SURFACE
#include <cairo-pdf.h>
#endif
-#ifdef CAIRO_HAS_SVG_SURFACE
-#include <cairo-svg.h>
-#endif
#ifdef CAIRO_HAS_WIN32_SURFACE
#include <cairo-win32.h>
/* avoid namespace collisions */
@@ -53,9 +49,7 @@
#include <cairo-script.h>
#endif
-#ifdef HAVE_PANGOCAIRO_H
#include <pango/pangocairo.h>
-#endif
#include "intl.h"
#include "geometry.h"
@@ -177,7 +171,6 @@ export_data(DiagramData *data, DiaContext *ctx,
#undef DPI
break;
#endif
-#ifdef CAIRO_HAS_SVG_SURFACE
case OUTPUT_SVG :
/* quite arbitrary, but consistent with ../pixbuf ;-) */
renderer->scale = 20.0 * data->paper.scaling;
@@ -189,7 +182,6 @@ export_data(DiagramData *data, DiaContext *ctx,
filename_crt,
(int)width, (int)height);
break;
-#endif
#ifdef CAIRO_HAS_SCRIPT_SURFACE
case OUTPUT_CAIRO_SCRIPT :
/* quite arbitrary, but consistent with ../pixbuf ;-) */
@@ -382,7 +374,6 @@ static DiaExportFilter pdf_export_filter = {
};
#endif
-#ifdef CAIRO_HAS_SVG_SURFACE
static const gchar *svg_extensions[] = { "svg", NULL };
static DiaExportFilter svg_export_filter = {
N_("Cairo Scalable Vector Graphics"),
@@ -392,7 +383,6 @@ static DiaExportFilter svg_export_filter = {
"cairo-svg",
FILTER_DONT_GUESS /* don't use this if not asked explicit */
};
-#endif
#ifdef CAIRO_HAS_SCRIPT_SURFACE
static const gchar *cs_extensions[] = { "cs", NULL };
@@ -496,16 +486,12 @@ _plugin_unload (PluginInfo *info)
#ifdef CAIRO_HAS_PDF_SURFACE
filter_unregister_export(&pdf_export_filter);
#endif
-#ifdef CAIRO_HAS_SVG_SURFACE
filter_unregister_export(&svg_export_filter);
-#endif
#ifdef CAIRO_HAS_SCRIPT_SURFACE
filter_unregister_export(&cs_export_filter);
#endif
-#if defined CAIRO_HAS_PNG_SURFACE || defined CAIRO_HAS_PNG_FUNCTIONS
filter_unregister_export(&png_export_filter);
filter_unregister_export(&pnga_export_filter);
-#endif
#if DIA_CAIRO_CAN_EMF
filter_unregister_export(&emf_export_filter);
filter_unregister_export(&wmf_export_filter);
@@ -536,16 +522,12 @@ dia_plugin_init(PluginInfo *info)
#ifdef CAIRO_HAS_PDF_SURFACE
filter_register_export(&pdf_export_filter);
#endif
-#ifdef CAIRO_HAS_SVG_SURFACE
filter_register_export(&svg_export_filter);
-#endif
#ifdef CAIRO_HAS_SCRIPT_SURFACE
filter_register_export(&cs_export_filter);
#endif
-#if defined CAIRO_HAS_PNG_SURFACE || defined CAIRO_HAS_PNG_FUNCTIONS
filter_register_export(&png_export_filter);
filter_register_export(&pnga_export_filter);
-#endif
#if DIA_CAIRO_CAN_EMF
filter_register_export(&emf_export_filter);
filter_register_export(&wmf_export_filter);
diff --git a/plug-ins/makefile.msc b/plug-ins/makefile.msc
index 4fefedb2..de2c755b 100644
--- a/plug-ins/makefile.msc
+++ b/plug-ins/makefile.msc
@@ -60,8 +60,8 @@ OBJECTS = \
!ENDIF
!IFDEF OBJ_cairo
-DEPCFLAGS = $(CAIRO_CFLAGS) -DHAVE_PANGOCAIRO_H
-PKG_LINK = $(PKG_LINK) $(CAIRO_LIBS) $(PANGOCAIRO_LIBS) gdi32.lib
+DEPCFLAGS = $(CAIRO_CFLAGS)
+PKG_LINK = $(PKG_LINK) $(CAIRO_LIBS) gdi32.lib
OBJECTS = \
diacairo.obj \
diacairo-interactive.obj \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]