[cairo-commit] src/cairo-fontconfig-private.h src/cairo-ft-font.c src/cairo-surface-subsurface.c src/cairo-xlib-screen.c src/Makefile.sources

Chris Wilson ickle at kemper.freedesktop.org
Mon Jun 28 09:12:13 PDT 2010


 src/Makefile.sources           |    1 
 src/cairo-fontconfig-private.h |   76 +++++++++++++++++++++++++++++++++++++++++
 src/cairo-ft-font.c            |    5 --
 src/cairo-surface-subsurface.c |    1 
 src/cairo-xlib-screen.c        |   20 ----------
 5 files changed, 80 insertions(+), 23 deletions(-)

New commits:
commit 97a88c5adb08a3181bad1f63a7bbdfe5784b4207
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 28 17:10:59 2010 +0100

    xlib: Compile without fontconfig
    
    Create a cairo-fontconfig-private.h where we can add the missing defines
    in a common location rather than in the body of the code.

diff --git a/src/Makefile.sources b/src/Makefile.sources
index 09da11c..1f12885 100644
--- a/src/Makefile.sources
+++ b/src/Makefile.sources
@@ -67,6 +67,7 @@ cairo_private = \
 	cairo-fixed-type-private.h \
 	cairo-freelist-private.h \
 	cairo-freed-pool-private.h \
+	cairo-fontconfig-private.h \
 	cairo-gstate-private.h \
 	cairo-hash-private.h \
 	cairo-image-info-private.h \
diff --git a/src/cairo-fontconfig-private.h b/src/cairo-fontconfig-private.h
new file mode 100644
index 0000000..7e29f69
--- /dev/null
+++ b/src/cairo-fontconfig-private.h
@@ -0,0 +1,76 @@
+/* cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2000 Keith Packard
+ * Copyright © 2005 Red Hat, Inc
+ * Copyright © 2010 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it either under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
+ *
+ * The Original Code is the cairo graphics library.
+ *
+ * The Initial Developer of the Original Code is Red Hat, Inc.
+ *
+ * Contributor(s):
+ *      Graydon Hoare <graydon at redhat.com>
+ *	Owen Taylor <otaylor at redhat.com>
+ *      Keith Packard <keithp at keithp.com>
+ *      Carl Worth <cworth at cworth.org>
+ *      Chris Wilson <chris at chris-wilson.co.uk>
+ */
+
+#ifndef _CAIRO_FONTCONFIG_PRIVATE_H
+#define _CAIRO_FONTCONFIG_PRIVATE_H
+
+#if CAIRO_HAS_FC_FONT
+#include <fontconfig/fontconfig.h>
+#include <fontconfig/fcfreetype.h>
+#endif
+
+/* sub-pixel order */
+#ifndef FC_RGBA_UNKNOWN
+#define FC_RGBA_UNKNOWN	    0
+#define FC_RGBA_RGB	    1
+#define FC_RGBA_BGR	    2
+#define FC_RGBA_VRGB	    3
+#define FC_RGBA_VBGR	    4
+#define FC_RGBA_NONE	    5
+#endif
+
+/* hinting style */
+#ifndef FC_HINT_NONE
+#define FC_HINT_NONE        0
+#define FC_HINT_SLIGHT      1
+#define FC_HINT_MEDIUM      2
+#define FC_HINT_FULL        3
+#endif
+
+/* LCD filter */
+#ifndef FC_LCD_NONE
+#define FC_LCD_NONE	    0
+#define FC_LCD_DEFAULT	    1
+#define FC_LCD_LIGHT	    2
+#define FC_LCD_LEGACY	    3
+#endif
+
+#endif /* _CAIRO_FONTCONFIG_PRIVATE_H */
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index d3b9660..78bc884 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -46,10 +46,7 @@
 
 #include <float.h>
 
-#if CAIRO_HAS_FC_FONT
-#include <fontconfig/fontconfig.h>
-#include <fontconfig/fcfreetype.h>
-#endif
+#include "cairo-fontcontig-private.h"
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
diff --git a/src/cairo-surface-subsurface.c b/src/cairo-surface-subsurface.c
index 59b56a4..c8d785b 100644
--- a/src/cairo-surface-subsurface.c
+++ b/src/cairo-surface-subsurface.c
@@ -534,3 +534,4 @@ cairo_surface_create_for_rectangle (cairo_surface_t *target,
 
     return &surface->base;
 }
+/* XXX observe mark-dirty */
diff --git a/src/cairo-xlib-screen.c b/src/cairo-xlib-screen.c
index db01a84..801dc3d 100644
--- a/src/cairo-xlib-screen.c
+++ b/src/cairo-xlib-screen.c
@@ -60,9 +60,7 @@
 #include "cairo-xlib-surface-private.h"
 #include "cairo-error-private.h"
 
-#if CAIRO_HAS_FC_FONT
-#include <fontconfig/fontconfig.h>
-#endif
+#include "cairo-fontconfig-private.h"
 
 static int
 parse_boolean (const char *v)
@@ -128,22 +126,6 @@ get_integer_default (Display    *dpy,
     return FALSE;
 }
 
-#ifndef FC_RGBA_UNKNOWN
-#define FC_RGBA_UNKNOWN	    0
-#define FC_RGBA_RGB	    1
-#define FC_RGBA_BGR	    2
-#define FC_RGBA_VRGB	    3
-#define FC_RGBA_VBGR	    4
-#define FC_RGBA_NONE	    5
-#endif
-
-#ifndef FC_HINT_NONE
-#define FC_HINT_NONE        0
-#define FC_HINT_SLIGHT      1
-#define FC_HINT_MEDIUM      2
-#define FC_HINT_FULL        3
-#endif
-
 static void
 _cairo_xlib_init_screen_font_options (Display *dpy,
 				      cairo_xlib_screen_t *info)


More information about the cairo-commit mailing list