summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2003-12-03 12:27:44 +0000
committerCarl Worth <cworth@cworth.org>2003-12-03 12:27:44 +0000
commitaae17d3b6b15881f7bd8c4fac6a14a0c7b6729e6 (patch)
treec48a1f231e476ee121f58d40e138a379430a8c10
parent9cf63b0390b71693a0eb3ba2e6065f7d3f6e240c (diff)
Bumped version to 0.1.14 to indicate dropped cairo-xlib.h and new cairo-config.h.
New support for "./configure --without-x" to compile without the xlib backend. Many thanks to Sasha V. <sasha@aftercode.net>. We do three things here: Make the pkg-config check for xrender conditional, set XLIB_BACKEND_DEFINE to either CAIRO_HAS_XLIB_BACKEND or CAIRO_HAS_NO_XLIB_BACKEND to be substituted into cairo-config.h, and set an AM_CONDITIONAL for HAVE_XLIB_BACKEND to enable conditional compilation of cairo_xlib_surface.c. Perhaps that could be simplified a tad, but it's what we have working now. Also split up various PKG_CHECK_MODULES into separate checks. Remove errant reference to cairo_gstate_set_drawable. Move xlib-specific calls in from old cairo-xlib.h, now guarded in #ifdef CAIRO_HAS_XLIB_BACKEND. Make compilation of cairo_xlib_surface.c conditional. (INCLUDES, libcairo_la_LIBADD): Add the new variables from splitting up the PKG_CHECK_MODULES calls.
-rw-r--r--ChangeLog28
-rw-r--r--configure.in19
-rw-r--r--src/.cvsignore1
-rw-r--r--src/Makefile.am14
-rw-r--r--src/cairo-config.h.in (renamed from src/cairo-xlib.h)42
-rw-r--r--src/cairo.h28
-rw-r--r--src/cairoint.h5
7 files changed, 88 insertions, 49 deletions
diff --git a/ChangeLog b/ChangeLog
index e4e748ec..73e62d73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,33 @@
2003-12-03 Carl Worth <cworth@east.isi.edu>
+ * configure.in: Bumped version to 0.1.14 to indicate dropped
+ cairo-xlib.h and new cairo-config.h.
+
+ * New support for "./configure --without-x" to compile without the
+ xlib backend. Many thanks to Sasha V. <sasha@aftercode.net>.
+
+ * configure.in: We do three things here: Make the pkg-config check
+ for xrender conditional, set XLIB_BACKEND_DEFINE to either
+ CAIRO_HAS_XLIB_BACKEND or CAIRO_HAS_NO_XLIB_BACKEND to be
+ substituted into cairo-config.h, and set an AM_CONDITIONAL for
+ HAVE_XLIB_BACKEND to enable conditional compilation of
+ cairo_xlib_surface.c. Perhaps that could be simplified a tad, but
+ it's what we have working now. Also split up various
+ PKG_CHECK_MODULES into separate checks.
+
+ * src/cairo_gstate.c: Remove errant reference to
+ cairo_gstate_set_drawable.
+
+ * src/cairo.h: Move xlib-specific calls in from old cairo-xlib.h,
+ now guarded in #ifdef CAIRO_HAS_XLIB_BACKEND.
+
+ * src/Makefile.am (libcairo_xlib_sources): Make compilation of
+ cairo_xlib_surface.c conditional.
+ (INCLUDES, libcairo_la_LIBADD): Add the new variables from
+ splitting up the PKG_CHECK_MODULES calls.
+
+2003-12-03 Carl Worth <cworth@east.isi.edu>
+
* cairo.pc.in (Libs): Add -lz for the compress function used in
the PS backend.
diff --git a/configure.in b/configure.in
index fbac8753..369f8ce4 100644
--- a/configure.in
+++ b/configure.in
@@ -3,7 +3,7 @@ AC_INIT(src/cairo.h)
dnl ===========================================================================
# Package version number, (as distinct from shared library version)
-CAIRO_VERSION=0.1.13
+CAIRO_VERSION=0.1.14
# libtool shared library version
@@ -38,9 +38,23 @@ dnl ===========================================================================
AC_PATH_XTRA
+if test "x$have_x" != "xyes"; then
+ XLIB_BACKEND_DEFINE=CAIRO_HAS_NO_XLIB_BACKEND
+else
+ XLIB_BACKEND_DEFINE=CAIRO_HAS_XLIB_BACKEND
+ PKG_CHECK_MODULES(XRENDER, xrender >= 0.6)
+fi
+
+AC_SUBST(XLIB_BACKEND_DEFINE)
+
+dnl This is needed for conditional compilation of xlib code in Makefile.am :
+dnl XXX: I'd prefer to have only one test of $have_x, would that be easy?
+AM_CONDITIONAL(HAVE_XLIB_BACKEND, test x$have_x = xyes)
+
dnl ===========================================================================
-PKG_CHECK_MODULES(CAIRO, fontconfig slim >= 0.2.0 libic >= 0.1.3 xrender >= 0.6)
+PKG_CHECK_MODULES(FONTCONFIG, fontconfig)
+PKG_CHECK_MODULES(CAIRO, slim >= 0.2.0 libic >= 0.1.3)
# Test for freetype2 separate from pkg-config since at least up to
# 2003-06-07, there was no freetype2.pc in the release.
@@ -95,4 +109,5 @@ AC_OUTPUT([
cairo.pc
Makefile
src/Makefile
+src/cairo-config.h
])
diff --git a/src/.cvsignore b/src/.cvsignore
index 08a8d2f4..b36696c6 100644
--- a/src/.cvsignore
+++ b/src/.cvsignore
@@ -5,3 +5,4 @@ Makefile.in
*.la
*.lo
*.loT
+cairo-config.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 8ff927be..1dd19ef3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,11 @@
lib_LTLIBRARIES = libcairo.la
-include_HEADERS = cairo.h cairo-xlib.h
+include_HEADERS = cairo.h cairo-config.h
+
+if HAVE_XLIB_BACKEND
+libcairo_xlib_sources = cairo_xlib_surface.c
+else
+libcairo_xlib_sources =
+endif
libcairo_la_SOURCES = \
cairo.c \
@@ -23,11 +29,11 @@ libcairo_la_SOURCES = \
cairo_spline.c \
cairo_surface.c \
cairo_traps.c \
- cairo_xlib_surface.c \
+ $(libcairo_xlib_sources)\
cairoint.h
libcairo_la_LDFLAGS = -version-info @VERSION_INFO@
-INCLUDES = $(CAIRO_CFLAGS) $(X_CFLAGS)
+INCLUDES = $(CAIRO_CFLAGS) $(FONTCONFIG_CFLAGS) $(XRENDER_CFLAGS) $(X_CFLAGS)
-libcairo_la_LIBADD = $(CAIRO_LIBS) -lm
+libcairo_la_LIBADD = $(CAIRO_LIBS) $(FONTCONFIG_LIBS) $(XRENDER_LIBS) $(X_LIBS) -lm
diff --git a/src/cairo-xlib.h b/src/cairo-config.h.in
index cbf2196d..f2525288 100644
--- a/src/cairo-xlib.h
+++ b/src/cairo-config.h.in
@@ -1,5 +1,5 @@
/*
- * Copyright © 2002 University of Southern California
+ * Copyright © 2003 University of Southern California
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
@@ -25,43 +25,9 @@
* Author: Carl D. Worth <cworth@isi.edu>
*/
-#ifndef _CAIRO_XLIB_H_
-#define _CAIRO_XLIB_H_
+#ifndef _CAIRO_CONFIG_H_
+#define _CAIRO_CONFIG_H_
-#include <X11/extensions/Xrender.h>
-
-#include "cairo.h"
-#ifdef _CAIROINT_H_
-#include <slim_export.h>
-#else
-#include <slim_import.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* XXX: This is a mess from the user's POV. Should the Visual or the
- cairo_format_t control what render format is used? Maybe I can have
- cairo_surface_create_for_window with a visual, and
- cairo_surface_create_for_pixmap with a cairo_format_t. Would that work?
-*/
-extern cairo_surface_t * __external_linkage
-cairo_xlib_surface_create (Display *dpy,
- Drawable drawable,
- Visual *visual,
- cairo_format_t format,
- Colormap colormap);
-
-extern void __external_linkage
-cairo_set_target_drawable (cairo_t *cr,
- Display *dpy,
- Drawable drawable);
-
-#ifdef __cplusplus
-}
-#endif
-
-#undef __external_linkage
+#define @XLIB_BACKEND_DEFINE@
#endif
diff --git a/src/cairo.h b/src/cairo.h
index 0d99ce64..818bcb69 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -99,6 +99,18 @@ cairo_set_target_ps (cairo_t *cr,
double x_pixels_per_inch,
double y_pixels_per_inch);
+#ifdef CAIRO_HAS_XLIB_BACKEND
+
+#include <X11/extensions/Xrender.h>
+
+/* XXX: This shold be renamed to cairo_set_target_xlib to match the
+ * other backends */
+extern void __external_linkage
+cairo_set_target_drawable (cairo_t *cr,
+ Display *dpy,
+ Drawable drawable);
+#endif /* CAIRO_HAS_X_BACKEND */
+
typedef enum cairo_operator {
CAIRO_OPERATOR_CLEAR,
CAIRO_OPERATOR_SRC,
@@ -608,6 +620,22 @@ cairo_ps_surface_create (FILE *file,
double x_pixels_per_inch,
double y_pixels_per_inch);
+#ifdef CAIRO_HAS_XLIB_BACKEND
+
+/* XXX: This is a mess from the user's POV. Should the Visual or the
+ cairo_format_t control what render format is used? Maybe I can have
+ cairo_surface_create_for_window with a visual, and
+ cairo_surface_create_for_pixmap with a cairo_format_t. Would that work?
+*/
+extern cairo_surface_t * __external_linkage
+cairo_xlib_surface_create (Display *dpy,
+ Drawable drawable,
+ Visual *visual,
+ cairo_format_t format,
+ Colormap colormap);
+
+#endif /* CAIRO_HAS_XLIB_BACKEND */
+
/* Matrix functions */
/* XXX: Rename all of these to cairo_transform_t */
diff --git a/src/cairoint.h b/src/cairoint.h
index 068addd1..036bff21 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -36,8 +36,6 @@
#ifndef _CAIROINT_H_
#define _CAIROINT_H_
-#include <X11/extensions/Xrender.h>
-
#include <assert.h>
#include <stdlib.h>
#include <string.h>
@@ -550,9 +548,6 @@ extern cairo_status_t __internal_linkage
_cairo_gstate_end_group (cairo_gstate_t *gstate);
extern cairo_status_t __internal_linkage
-_cairo_gstate_set_drawable (cairo_gstate_t *gstate, Drawable drawable);
-
-extern cairo_status_t __internal_linkage
_cairo_gstate_set_target_surface (cairo_gstate_t *gstate, cairo_surface_t *surface);
extern cairo_surface_t * __internal_linkage