From aae17d3b6b15881f7bd8c4fac6a14a0c7b6729e6 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 3 Dec 2003 12:27:44 +0000 Subject: 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. . 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. --- ChangeLog | 28 +++++++++++++++++++++ configure.in | 19 +++++++++++++-- src/.cvsignore | 1 + src/Makefile.am | 14 ++++++++--- src/cairo-config.h.in | 33 +++++++++++++++++++++++++ src/cairo-xlib.h | 67 --------------------------------------------------- src/cairo.h | 28 +++++++++++++++++++++ src/cairoint.h | 5 ---- 8 files changed, 117 insertions(+), 78 deletions(-) create mode 100644 src/cairo-config.h.in delete mode 100644 src/cairo-xlib.h diff --git a/ChangeLog b/ChangeLog index e4e748ec..73e62d73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2003-12-03 Carl Worth + + * 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. . + + * 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 * cairo.pc.in (Libs): Add -lz for the compress function used in 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-config.h.in b/src/cairo-config.h.in new file mode 100644 index 00000000..f2525288 --- /dev/null +++ b/src/cairo-config.h.in @@ -0,0 +1,33 @@ +/* + * 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 + * fee, provided that the above copyright notice appear in all copies + * and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of the + * University of Southern California not be used in advertising or + * publicity pertaining to distribution of the software without + * specific, written prior permission. The University of Southern + * California makes no representations about the suitability of this + * software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * THE UNIVERSITY OF SOUTHERN CALIFORNIA DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF + * SOUTHERN CALIFORNIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Carl D. Worth + */ + +#ifndef _CAIRO_CONFIG_H_ +#define _CAIRO_CONFIG_H_ + +#define @XLIB_BACKEND_DEFINE@ + +#endif diff --git a/src/cairo-xlib.h b/src/cairo-xlib.h deleted file mode 100644 index cbf2196d..00000000 --- a/src/cairo-xlib.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright © 2002 University of Southern California - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without - * fee, provided that the above copyright notice appear in all copies - * and that both that copyright notice and this permission notice - * appear in supporting documentation, and that the name of the - * University of Southern California not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. The University of Southern - * California makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * THE UNIVERSITY OF SOUTHERN CALIFORNIA DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF - * SOUTHERN CALIFORNIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Carl D. Worth - */ - -#ifndef _CAIRO_XLIB_H_ -#define _CAIRO_XLIB_H_ - -#include - -#include "cairo.h" -#ifdef _CAIROINT_H_ -#include -#else -#include -#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 - -#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 + +/* 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 - #include #include #include @@ -549,9 +547,6 @@ _cairo_gstate_begin_group (cairo_gstate_t *gstate); 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); -- cgit v1.2.3